LinkPanel
is a Panel
used to position and orient elements along the route of a Link.
Visual Basic (Declaration) | |
---|---|
Public Class LinkPanel Inherits System.Windows.Controls.Panel |
C# | |
---|---|
public class LinkPanel : System.Windows.Controls.Panel |
The simplest Link is implemented with a DataTemplate
that consists of a Shape
that is the stroke (a line) connecting one node with another. In WPF that is normally an instance of LinkShape
; in Silverlight that is normally an instance of System.Windows.Shapes.Path
. Such a link cannot have any arrowheads or text labels or other decorations. Furthermore you cannot connect any link to or from the link itself, nor can any link labels be selectable or manipulable as separate objects.
However, most Diagram.LinkTemplates are implemented as DataTemplate
s consisting of LinkPanels. The principal child element of a LinkPanel
is normally a LinkShape
(WPF) or Path
(Silverlight) that has the x:Name
of "Path" and that has the attached property IsLinkShapeProperty set to true. The panel arranges the other child elements along the Link's Route according to various attached properties.
At the current time a LinkPanel
or LinkShape
/Path
must be the root visual element of a Link.
Here is a simple DataTemplate
for a Link that has an arrowhead:
<DataTemplate x:Key="ExampleLinkTemplate"> <go:LinkPanel go:Link.SelectionElementName="Path" go:Link.SelectionAdorned="True" > <go:LinkShape x:Name="Path" go:LinkPanel.IsLinkShape="True" Stroke="Black" StrokeThickness="1" /> <Polygon Fill="Black" Points="8 4 0 8 2 4 0 0" go:LinkPanel.Alignment="1 0.5" go:LinkPanel.Index="-1" go:LinkPanel.Orientation="Along" /> </go:LinkPanel> </DataTemplate>
System.Object
System.Windows.DependencyObject
System.Windows.UIElement
System.Windows.FrameworkElement
System.Windows.Controls.Panel
Northwoods.GoXam.LinkPanel