本人小白,为什么我在WPF 的ScrollViewer添加MouseLeftButton事件点击鼠标却一点反应都没有,在xaml添加了事件,后台也添加了方法
<ScrollViewer HorizontalAlignment="Left" Height="276" Margin="35,34,0,0" VerticalAlignment="Top" Width="472" MouseLeftButtonDown="ScrollViewer_MouseLeftButtonDown_1">
<TextBlock Height="54" TextWrapping="Wrap" Text="TextBlock" Width="171"/>
</ScrollViewer>
private void ScrollViewer_MouseLeftButtonDown_1(object sender, MouseButtonEventArgs e)
{
MessageBox.Show("Error!");
}