Want to become a Vibe Coder? Join Vibe Coding Training here
x
C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Understanding of Tunnelling Concept in WPF
WhatsApp
ashok rathod
Jul 29
2015
1.6
k
0
0
TunnelingEvents.zip
<Window x:Class=
"LearningWPF.MainWindow"
xmlns=
"http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x=
"http://schemas.microsoft.com/winfx/2006/xaml"
Title=
"MainWindow"
Height=
"350"
Width=
"525"
>
<Grid Height=
"100"
Width=
"500"
HorizontalAlignment=
"Center"
VerticalAlignment=
"Center"
PreviewMouseDown=
"Grid_PreviewMouseDown"
>
<Grid.RowDefinitions></Grid.RowDefinitions>
<StackPanel Grid.Row=
"0"
PreviewMouseDown=
"StackPanel_PreviewMouseDown"
>
<Button x:Name=
"btnClick"
Content=
"Click Me"
Height=
"50"
Width=
"90"
PreviewMouseDown=
"btnClick_PreviewMouseDown"
/>
</StackPanel>
</Grid>
</Window>
using
System.Windows;
using
System.Windows.Input;
namespace
LearningWPF {
public
partial
class
MainWindow: Window {
public
MainWindow() {
InitializeComponent();
}
private
void
Grid_PreviewMouseDown(
object
sender, MouseButtonEventArgs e) {
MessageBox.Show(
"Grid Preview MouseDown Called"
);
}
private
void
StackPanel_PreviewMouseDown(
object
sender, MouseButtonEventArgs e) {
MessageBox.Show(
"StackPanel Preview MouseDown Called"
);
}
private
void
btnClick_PreviewMouseDown(
object
sender, MouseButtonEventArgs e) {
MessageBox.Show(
"Button Preview MouseDown Called"
);
}
}
}
wpf
bubbling
routing strategy
Up Next
Understanding of Tunnelling Concept in WPF