<Windowx:Class="形状.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:形状"mc:Ignorable="d"Title="MainWindow"Height="350"Width="525"><Grid><Grid.RowDefinitions><RowDefinitionHeight="Auto"></RowDefinition><RowDefinitionHeight="*"></RowDefinition></Grid.RowDefinitions><TextBlockMargin="66,-13,-66,13">The first row of a grid</TextBlock><ViewboxGrid.Row="2"HorizontalAlignment="Left"><CanvasWidth="200"Height="150"><!--开始线帽 StrokeStartLineCap="Round"结束线帽 StrokeEndLineCap="Round" --><LineStrokeThickness="5"StrokeStartLineCap="Round"StrokeEndLineCap="Round"Canvas.Left="150"Canvas.Top="20"Stroke="Red"X1="0"Y1="0"X2="10"Y2="100"></Line><RectangleFill="Yellow"Stroke="Blue"Canvas.Left="30"Canvas.Top="40"Height="60"Width="100"HorizontalAlignment="Left"></Rectangle><EllipseHorizontalAlignment="Left"Fill="Yellow"Stroke="Blue"Canvas.Left="10"Canvas.Top="50"Width="100"Height="50"></Ellipse><PolylineStroke="Blue"StrokeDashArray="1 2"Points="5,5 15,50 50,70 100,1"></Polyline></Canvas></Viewbox></Grid></Window>