[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();

}

 






-------------------------------------------------------------------------------------





[실행결과]









Posted by holland14
: