<!--WindowStartupLocation:设定项目启动位置-->
<Window x:Class="HappyWpf.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:HappyWpf"
mc:Ignorable="d"
Title="MainWindow" Height="350" Width="525" WindowStartupLocation="CenterScreen">
<Window.Resources>
<local:Human x:Key="human" x:Name="Tim1"/>
</Window.Resources>
<Grid>
<StackPanel>
<!--绘制矩形:Stroke:矩形的边框颜色 RadiusX:圆角的半径大小-->
<Rectangle Width="100" Height="80" Stroke="Black" Fill="Blue" RadiusX="10" RadiusY="10"/>
<!--Path:绘制路径-->
<Path Data="M10,10 L200,100 L100,200 Z" Stroke="Black" Fill="Red"/>
<Button Content="Show" Width="120" Height="30" Click="Button_Click"/>
</StackPanel>
</Grid>
效果图: