DiagramLayout
is the base class for all of the predefined specific layout implementations.
Visual Basic (Declaration) | |
---|---|
Public Class DiagramLayout Inherits System.Windows.FrameworkElement Implements IDiagramLayout |
C# | |
---|---|
public class DiagramLayout : System.Windows.FrameworkElement, IDiagramLayout |
This provides a rudimentary default layout that will position all of the nodes that have no position (i.e. the Northwoods.GoXam.Node.Location is NaN, NaN
). Nodes that already have a position are ignored. The layout behavior may be improved in the future.
The Northwoods.GoXam.LayoutManager will call DiagramLayout.CanLayoutPart to decide which Northwoods.GoXam.Nodes and Northwoods.GoXam.Links will be passed to DiagramLayout.DoLayout. DiagramLayout.CanLayoutPart looks at this layout's Id and the part's Part.LayoutId to see if they match, among other criteria.
As changes occur to the diagram, such as the addition of a Northwoods.GoXam.Node or the removal of a Northwoods.GoXam.Link or the change in size of a Group, the DiagramLayout.Invalidate method will be called. Depending on the kind of change and on the value of Northwoods.GoXam.Layout.DiagramLayout.Conditions, the DiagramLayout.ValidLayout property may be set to false. At a later time, such as at the end of a transaction, the Northwoods.GoXam.LayoutManager will call DiagramLayout.DoLayout to make the layout valid again.
To implement your own custom layouts, you can inherit from either this class or from one of the other predefined layout classes, overriding the DiagramLayout.DoLayout method. You can call the Node.Move method to re-position a node, including whole groups, possibly with animation. Install the layout as the value of Layout or Group.Layout.
Although this class inherits from FrameworkElement
in order to support data binding, it is not really a FrameworkElement
or UIElement
! Please ignore all of the properties, methods, and events defined by FrameworkElement
and UIElement
.
System.Object
System.Windows.DependencyObject
System.Windows.UIElement
System.Windows.FrameworkElement
Northwoods.GoXam.Layout.DiagramLayout
Northwoods.GoXam.Layout.CircularLayout
Northwoods.GoXam.Layout.ForceDirectedLayout
Northwoods.GoXam.Layout.GridLayout
Northwoods.GoXam.Layout.LayeredDigraphLayout
Northwoods.GoXam.Layout.TreeLayout