Mega Code Archive

 
Categories / VB.Net / WPF
 

Create Reusable Shapes

<Window x:Class="WpfApplication1.Window1"     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"     Title="WPF" Height="350" Width="300">     <Window.Resources>         <GeometryGroup x:Key="Clown">             <PathGeometry>                 <PathFigure IsClosed="True" StartPoint="40,0">                     <ArcSegment Point="110,110" Size="30,30" SweepDirection="Clockwise"/>                     <ArcSegment Point="110,100" IsLargeArc="True" Size="10,10" SweepDirection="Clockwise"/>                 </PathFigure>             </PathGeometry>             <EllipseGeometry Center="410,110" RadiusX="3" RadiusY="3"/>             <RectangleGeometry Rect="310,120 20,10"/>         </GeometryGroup>     </Window.Resources>     <UniformGrid Columns="2" Rows="2">         <Path HorizontalAlignment="Center" Data="{StaticResource Clown}" Stroke="Black" StrokeThickness="1" Margin="5" Fill="BurlyWood"/>     </UniformGrid> </Window>