WPF-Base/WPF路由事件-3-冒泡路由事件/MainWindow.xaml

34 lines
1.7 KiB
XML

<Window x:Class="WPF路由事件_3_冒泡路由事件.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"
mc:Ignorable="d"
Icon="public/logo.ico" MouseUp="MainWindow_OnMouseUp"
Title="WPF路由事件_3_冒泡路由事件" Height="800" Width="400">
<Grid Margin="3" MouseUp="MainWindow_OnMouseUp">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Label Margin="5" Grid.Row="0" HorizontalAlignment="Left" Background="AliceBlue " BorderBrush="Black"
BorderThickness="1" MouseUp="MainWindow_OnMouseUp">
<StackPanel MouseUp="MainWindow_OnMouseUp">
<TextBlock Margin="3" MouseUp="MainWindow_OnMouseUp">Image and text label </TextBlock>
<Image Source="public/test-image.jpg" Stretch="Uniform" MouseUp="MainWindow_OnMouseUp" Width="322" />
<TextBlock Margin="3" MouseUp="MainWindow_OnMouseUp">Courtesy of the stackPanel </TextBlock>
</StackPanel>
</Label>
<ListBox Grid.Row="1" Margin="5" Name="ListBoxMessage" />
<CheckBox Grid.Row="2" Name="CheckBoxHandle">Handle first event</CheckBox>
<Button Grid.Row="3" Margin="5" Padding="3" HorizontalAlignment="Right" Name="CmdClear"
Click="CmdClear_OnClick">
清除列表
</Button>
</Grid>
</Window>