Northwoods.GoSilverlight 1.2.2 Assembly
NodeShape Class
Members  See Also  Send Feedback
Northwoods.GoXam Namespace : NodeShape Class

This Shape can be used in a NodePanel as the background for text and/or other elements.

Syntax

Visual Basic (Declaration) 
Public Class NodeShape 
   Inherits System.Windows.Shapes.Path
C# 
public class NodeShape : System.Windows.Shapes.Path 

Remarks

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 3, you must use the <Path> element instead of a <go:NodeShape> element. In Silverlight 4, you may use either the <Path> element or a <go:NodeShape> element. In Silverlight, the element must be a child of a NodePanel.

Inheritance Hierarchy

System.Object
   System.Windows.DependencyObject
      System.Windows.UIElement
         System.Windows.FrameworkElement
            System.Windows.Shapes.Shape
               System.Windows.Shapes.Path
                  Northwoods.GoXam.NodeShape

Requirements

See Also

© 2010 All Rights Reserved.