I am studying and extending the famous WPF Diagram Designer (Part 4) from codeproject.
Here is a snippet :
<!-- Document --><Style x:Key="Document" TargetType="Path" BasedOn="{StaticResource FlowChartItemStyle}"><Setter Property="Data" Value="M 0,0 H 60 V 40 C 30,30 30,50 0,40 Z"/></Style><Style x:Key="Document_DragThumb" TargetType="Path" BasedOn="{StaticResource Document}"><Setter Property="IsHitTestVisible" Value="true"/><Setter Property="Fill" Value="Transparent"/><Setter Property="Stroke" Value="Transparent"/></Style><!-- ... --><s:DesignerItem.DragThumbTemplate><ControlTemplate><Path Style="{StaticResource Document_DragThumb}"/></ControlTemplate></s:DesignerItem.DragThumbTemplate>
It created a ControlTemplate for the DesignerItem from a Path.
How can I create a ControlTemplate from a Path in C# codes?