Original: WPF notes (1.10 Drawing)--hello,wpf!
The code syntax in the book is obsolete and is rewritten as follows (test pass):
<Button>
<Button.layouttransform>
<ScaleTransform ScaleX="3"ScaleY="3" />
</Button.layouttransform>
<StackPanel Orientation="Horizontal">
<Canvas Width=" -"Height=" -"VerticalAlignment="Center">
<Ellipse Canvas.Left="1"Canvas.Top="1"Width=" -"Height=" -"
Fill="Yellow"Stroke="Black" />
<Ellipse Canvas.Left="4.5"Canvas.Top="5"Width="2.5"Height="3"
Fill="Black" />
<Ellipse Canvas.Left=" One"Canvas.Top="5"Width="2.5"Height="3"
Fill="Black" />
<Path Data="M 5,10 A 3,3 0 0 0 13,10"Stroke="Blue" />
</Canvas>
<TextBlock VerticalAlignment="Center">Click!</TextBlock>
</StackPanel>
</Button>
ScaleTransform zooms the button 3 times times.
Canvas paint, draw a smiley face, 3 oval, yellow is the outline of the face, yellow is the eyes. The blue pen is the mouth-you can see by the way how these four elements are positioned precisely on a canvas.
WPF notes (1.10 Drawing)--hello,wpf!