Could not able to fire events to StackPanel which is inside the ScrollViewer.
we tried with Panel.ZIndex but no luck.
Greatly appreciated for help.
Window1.xaml file
Minimum="{Binding ElementName=root, Path=Minimum}"
Maximum="{Binding ElementName=root, Path=Maximum}"
Value="{Binding ElementName=root, Path=UpperValue, Mode=TwoWay}"
Margin="0,15,0,0" />
Window1.xaml.cs file
private void xxScrollBar_PreviewMouseDown(object sender, MouseButtonEventArgs e)
{
if (e.Source.GetType() == typeof(StackPanel))
{
}
}
private void StackPanel_PreviewMouseDown(object sender, MouseButtonEventArgs e)
{
MessageBox.Show("Clicked on StackPanel");
}
private void StackPanel_MouseDown(object sender, MouseButtonEventArgs e)
{
MessageBox.Show("Clicked on StackPanel");
}


Shweta LodhaRank #31 · 39.8K reputationPosted Jan 23, 2017, 10:46 PM EST
Hello Negi,
I tried the code which you pasted here and I'm able to get messagebox mentioned in event named:
StackPanel_PreviewMouseDown
Please elaborate more, which event are you talking about? If you are talking about MouseDown event then here is your answer:
Nagi ARank #1,870 · 797 reputationPosted Jan 24, 2017, 12:17 AM EST