Northwoods.GoXam Namespace : NodeShape Class |
Shape
can be used in a NodePanel as the background for text and/or other elements.You will need to set the NodePanel.Figure
attached property (see cref="NodePanel.SetFigure"/>) to give the shape a predefined geometry. The geometry of some figures can be customized by setting parameters (also NodePanel attached properties).
In addition to setting the usual properties of the Shape
such as Fill
, Stroke
, StrokeThickness
, et al., remember to set the Width
and Height
, unless this shape is the first child of a NodePanel with a NodePanel.Sizing other than NodePanelSizing.Fixed, in which case the NodePanel will size this shape appropriately.
The NodePanel uses the NodePanel.Spot1
and NodePanel.Spot2
attached properties to control where in the shape the text element(s) should be placed.
A typical usage: <DataTemplate x:Key="ExampleNodeTemplate"> <go:NodePanel go:Node.Location="{Binding Path=Data.XY, Mode=TwoWay}" go:Node.SelectionElementName="Shape" go:Node.Resizable="True"> <go:NodeShape x:Name="Shape" go:NodePanel.Figure="RoundedRectangle" Width="50" Height="20" Stroke="Gray" StrokeThickness="1" Fill="LightYellow" /> <TextBlock Text="{Binding Path=Data.Name}" TextWrapping="Wrap" /> </go:NodePanel> </DataTemplate>
In WPF, you must use the <go:NodeShape>
element instead of a <Path>
element. In Silverlight, you may use either the <go:NodeShape>
element or a <Path>
element. But in Silverlight, the element must be a child of a NodePanel.
System.Object
System.Windows.Threading.DispatcherObject
System.Windows.DependencyObject
System.Windows.Media.Visual
System.Windows.UIElement
System.Windows.FrameworkElement
System.Windows.Shapes.Shape
Northwoods.GoXam.NodeShape