Silverlight XAML Primer 2, Listing 2: Using XAML to Define Shapes and Text

<Canvas xmlns="http://schemas.microsoft.com/client/2007">
	<Rectangle Canvas.Top="25" Canvas.Left="25" 
	 Width="200" Height="150" Fill="Yellow" />

	<Ellipse Height="100" Width="100" Canvas.Left="10" Canvas.Top="10" 
   
	Stroke="Black" StrokeThickness="2" Fill="Blue"/>

 <Line X1="36" Y1="115" X2="350" Y2="115"
  Stroke="Black" StrokeThickness="2" Opacity=".4"/>

 <Line X1="36" Y1="155" X2="350" Y2="155"
	 Stroke="Black" StrokeThickness="2" Opacity=".4" />
 
 <Polyline Canvas.Left="150" Canvas.Top="0" Stroke="Green" 

 	StrokeThickness="5" Fill="Red"
	Points="50,25 0,100 100,100 48,25" />	
 
	<TextBlock Name="tbHello"
	 Canvas.Left="36" Canvas.Top="120"
	 Foreground="Maroon" FontFamily="Verdana" FontSize="24"
	 FontWeight="Bold" Text="Hello From Silverlight!">
	</TextBlock>

</Canvas>
comments powered by Disqus
Upcoming Events

.NET Insight

Sign up for our newsletter.

I agree to this site's Privacy Policy.