Mega Code Archive

 
Categories / Silverlight / Shapes
 

Path Margin as resource

<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'>         <StackPanel Orientation="Horizontal">           <StackPanel.Resources>             <Style TargetType="Path">               <Setter Property="Margin" Value="5" />             </Style>           </StackPanel.Resources>         <Path Fill="Cyan" Stroke="Black">           <Path.Data>             <PathGeometry>               <PathGeometry.Figures>                 <PathFigure StartPoint="0,0" IsClosed="True">                   <LineSegment Point="50,0" />                   <LineSegment Point="50,50" />                   <LineSegment Point="0,50" />                 </PathFigure>               </PathGeometry.Figures>             </PathGeometry>           </Path.Data>         </Path>         </StackPanel> </UserControl>