Intersoft ClientUI 8 > ClientUI Fundamentals > Routed Events Overview > Routed Events How-to Topics > How to: Add an Event Handler in XAML |
This example shows how to add an event handler to a Button in XAML and write the handler that can process the routed event data.
Routed events typically follow one of two routing strategies, bubbling or tunneling. This example focuses on the bubbling event and shows how to handle the Click event of a Button.
XAML |
Copy Code
|
---|---|
<Grid x:Name="LayoutRoot"> <StackPanel> <Intersoft:UXButton Name="button1" Click="button1_Click" Content="Button" HorizontalAlignment="Left" VerticalAlignment="Top" /> </StackPanel> </Grid> |
C# |
Copy Code
|
---|---|
private void button1_Click(object sender, RoutedEventArgs e) { MessageBox.Show("Button1 Clicked"); } |