TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Nagi A
1.3k
404
12k
Could not able to fire events to StackPanel in ScrollViewer
Jan 24 2017 1:58 AM
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
<ScrollViewer Name="xxScrollBar" Panel.ZIndex="0" >
<StackPanel PreviewMouseDown="StackPanel_PreviewMouseDown" Panel.ZIndex="1000" MouseDown="StackPanel_MouseDown">
<Slider x:Name="UpperSlider"
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" />
<Button x:Name="button1" Content="Button" HorizontalAlignment="Left" VerticalAlignment="Top" Width="75"/>
</StackPanel>
</ScrollViewer>
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");
}
Attachment:
WpfApplication1.zip
Reply
Answers (
2
)
wpf binding not work on custom list object
Programing in WPF