1。给一个stop按钮赋予一个stop的图形。
如图:
代码如下:
1 <Window x:Class="wpfTest.MainWindow"
2 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4 xmlns:local="clr-namespace:wpfTest"
5 Title="MainWindow" Height="350" Width="525">
6 <Window.Resources>
7 <local:Human x:Key="wtqHum" name="wtq" child="thisismyname" ></local:Human>
8
9 </Window.Resources>
10
11 <Grid>
12
13 <Button Width="100" Height="30">
14 <Button.Content>
15 <Rectangle Width="15" Height="15" Stroke="Blue" Fill="Red"></Rectangle>
16 </Button.Content>
17
18 </Button>
19 </Grid>
20 </Window>
2 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4 xmlns:local="clr-namespace:wpfTest"
5 Title="MainWindow" Height="350" Width="525">
6 <Window.Resources>
7 <local:Human x:Key="wtqHum" name="wtq" child="thisismyname" ></local:Human>
8
9 </Window.Resources>
10
11 <Grid>
12
13 <Button Width="100" Height="30">
14 <Button.Content>
15 <Rectangle Width="15" Height="15" Stroke="Blue" Fill="Red"></Rectangle>
16 </Button.Content>
17
18 </Button>
19 </Grid>
20 </Window>