|
|
|
|
<Window x:Class="RoutedEventSample.MainWindow"
|
|
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
|
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
|
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
|
|
|
xmlns:local="clr-namespace:RoutedEventSample"
|
|
|
|
|
mc:Ignorable="d"
|
|
|
|
|
Title="MainWindow" Height="450" Width="800"
|
|
|
|
|
ButtonBase.Click="Window_Click"
|
|
|
|
|
PreviewMouseDown="Window_PreviewMouseDown">
|
|
|
|
|
<Grid>
|
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
|
|
|
|
|
<TextBlock Grid.Row="0" FontSize="18" FontWeight="Bold" HorizontalAlignment="Center" Text="Bubbling Sample"/>
|
|
|
|
|
<StackPanel x:Name="spBubbling" Margin="20" ButtonBase.Click="spBubbling_Click">
|
|
|
|
|
<StackPanel Margin="10">
|
|
|
|
|
<TextBlock x:Name="tb1" Margin="5" HorizontalAlignment="Center"
|
|
|
|
|
Text="This is TextBox1"/>
|
|
|
|
|
<TextBlock x:Name="tb2" Margin="5" HorizontalAlignment="Center"
|
|
|
|
|
Text="This is TextBox2"/>
|
|
|
|
|
<TextBlock x:Name="tb3" Margin="5" HorizontalAlignment="Center"
|
|
|
|
|
Text="This is TextBox3"/>
|
|
|
|
|
</StackPanel>
|
|
|
|
|
<Button x:Name="btnBubbling" Width="80" Margin="10" Content="Click me" Click="btnBubbling_Click"/>
|
|
|
|
|
</StackPanel>
|
|
|
|
|
|
|
|
|
|
<TextBlock Grid.Row="3" FontSize="18" FontWeight="Bold" HorizontalAlignment="Center" Text="Tunneling Sample"/>
|
|
|
|
|
<StackPanel Grid.Row="4" x:Name="spTunneling" Width="200" Height="120" HorizontalAlignment="Center" VerticalAlignment="Center" Background="Transparent"
|
|
|
|
|
PreviewMouseDown="spTunneling_PreviewMouseDown">
|
|
|
|
|
<Border VerticalAlignment="Top" Margin="20" Padding="5" Background="Bisque"
|
|
|
|
|
BorderBrush="PaleVioletRed" BorderThickness="3 5 3 5"
|
|
|
|
|
CornerRadius="5">
|
|
|
|
|
<Button x:Name="btnTunneling" Width="50" Height="50" Margin="15"
|
|
|
|
|
PreviewMouseDown="btnTunneling_PreviewMouseDown"/>
|
|
|
|
|
</Border>
|
|
|
|
|
</StackPanel>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Window>
|