Mega Code Archive

 
Categories / Silverlight / Shapes
 

Drawn with a Path Shape with Geometry

<UserControl x:Class='SilverlightApplication3.MainPage'     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:DesignWidth='640'      d:DesignHeight='480'>    <Canvas>            <Path Stroke="Black" StrokeThickness="1" Fill="#CCCCFF">             <Path.Data>               <GeometryGroup>                   <RectangleGeometry Rect="50,5 100,10" />                   <RectangleGeometry Rect="5,5 95,180" />                   <EllipseGeometry Center="100, 100" RadiusX="20" RadiusY="30"/>                   <RectangleGeometry Rect="50,175 100,10" />                   <PathGeometry>                     <PathGeometry.Figures>                       <PathFigureCollection>                         <PathFigure IsClosed="true" StartPoint="50,50">                           <PathFigure.Segments>                             <PathSegmentCollection>                               <BezierSegment Point1="75,300" Point2="125,100" Point3="150,50"/>                               <BezierSegment Point1="125,300" Point2="75,100"  Point3="50,50"/>                             </PathSegmentCollection>                           </PathFigure.Segments>                         </PathFigure>                       </PathFigureCollection>                     </PathGeometry.Figures>                   </PathGeometry>                              </GeometryGroup>             </Path.Data>           </Path>           </Canvas>  </UserControl>