도형(Shape) - <Rectangle /> : 사각형
.NET프로그래밍/Silverlight 3.0 2009. 11. 25. 09:54 |
[FrmRectangle.xaml]
<UserControl x:Class="RiaShape.FrmRectangle"
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"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="400">
<Canvas Width="400" Height="400" Background="White">
<Rectangle Canvas.Top="5" Canvas.Left="5" Width="150" Height="150" Fill="Red" />
<Rectangle Canvas.Top="5" Canvas.Left="160" Width="150" Height="150" Fill="Orange" Stroke="Black" />
<Rectangle Canvas.Top="160" Canvas.Left="5" Width="150" Height="150" Fill="Blue" Stroke="Black" StrokeThickness="5" />
<Rectangle Canvas.Top="160" Canvas.Left="160" Width="150" Height="150" Fill="Green" Stroke="red" StrokeThickness="5" RadiusX="15" RadiusY="15" />
</Canvas>
</UserControl>
-------------------------------------------------------------------------------------
[App.xaml.cs]
private void Application_Startup(object sender, StartupEventArgs e)
{
this.RootVisual = new FrmRectangle();
}
-------------------------------------------------------------------------------------
[실행결과]
'.NET프로그래밍 > Silverlight 3.0' 카테고리의 다른 글
도형(Shape) - <Line> : 선 (0) | 2009.11.25 |
---|---|
도형(Shape) - <Ellipse> : 타원 (0) | 2009.11.25 |
레이아웃 확장 - DockPanel (0) | 2009.11.25 |
레이아웃 확장 - WrapPanel (0) | 2009.11.25 |
레이아웃 - <Border />클래스 (레이아웃에 테두리 주기) (0) | 2009.11.24 |