BaseConnection
BaseConnection Class
Section titled “BaseConnection Class”Namespace: Nodify
Assembly: Nodify
Inheritance: Object → DispatcherObject → DependencyObject → Visual → UIElement → FrameworkElement → Shape → BaseConnection
Implements: IKeyboardFocusTarget<FrameworkElement>
Derived: LineConnection, Connection
References: ArrowHeadEnds, ArrowHeadShape, ConnectionDirection, ConnectionEventArgs, ConnectionEventHandler, ConnectionOffsetMode, CuttingLine, ConnectionState.Disconnect, NodifyEditor, ConnectionState.Split
Represents the base class for shapes that are drawn from a BaseConnection.Source point to a BaseConnection.Target point.
public abstract class BaseConnection : Shape, IKeyboardFocusTarget<FrameworkElement>
Constructors
Section titled “Constructors”BaseConnection()
Section titled “BaseConnection()”protected BaseConnection();
Fields
Section titled “Fields”ZeroVector
Section titled “ZeroVector”Gets a vector that has its coordinates set to 0.
protected static Vector ZeroVector;
Field Value
Properties
Section titled “Properties”ArrowEnds
Section titled “ArrowEnds”Gets or sets the arrowhead ends.
public ArrowHeadEnds ArrowEnds { get; set; }
Property Value
ArrowShape
Section titled “ArrowShape”Gets or sets the arrowhead ends.
public ArrowHeadShape ArrowShape { get; set; }
Property Value
ArrowSize
Section titled “ArrowSize”Gets or sets the size of the arrow head.
public Size ArrowSize { get; set; }
Property Value
DefiningGeometry
Section titled “DefiningGeometry”protected override Geometry DefiningGeometry { get; set; }
Property Value
Direction
Section titled “Direction”Gets or sets the direction in which this connection is flowing.
public ConnectionDirection Direction { get; set; }
Property Value
DirectionalArrowsAnimationDuration
Section titled “DirectionalArrowsAnimationDuration”Gets or sets the duration in seconds of a directional arrow flowing from BaseConnection.Source to BaseConnection.Target.
public double DirectionalArrowsAnimationDuration { get; set; }
Property Value
DirectionalArrowsCount
Section titled “DirectionalArrowsCount”Gets or sets the number of arrows to be drawn on the line in the direction of the connection (see BaseConnection.Direction).
public uint DirectionalArrowsCount { get; set; }
Property Value
DirectionalArrowsOffset
Section titled “DirectionalArrowsOffset”Gets or sets the offset of the arrows drawn by the BaseConnection.DirectionalArrowsCount (value is clamped between 0 and 1).
public double DirectionalArrowsOffset { get; set; }
Property Value
DisconnectCommand
Section titled “DisconnectCommand”Removes this connection. Triggered by Nodify.Interactivity.EditorGestures.ConnectionGestures.Disconnect gesture. Parameter is the location where the disconnect ocurred.
public ICommand DisconnectCommand { get; set; }
Property Value
FocusVisualPadding
Section titled “FocusVisualPadding”The space between the focus visual and the connection geometry.
public double FocusVisualPadding { get; set; }
Property Value
FocusVisualPen
Section titled “FocusVisualPen”The pen used to render the focus visual.
public Pen FocusVisualPen { get; set; }
Property Value
FocusVisualPenKey
Section titled “FocusVisualPenKey”The key used to retrieve the BaseConnection.FocusVisualPen resource.
public static ResourceKey FocusVisualPenKey { get; set; }
Property Value
FontFamily
Section titled “FontFamily”public FontFamily FontFamily { get; set; }
Property Value
FontSize
Section titled “FontSize”public double FontSize { get; set; }
Property Value
FontStretch
Section titled “FontStretch”public FontStretch FontStretch { get; set; }
Property Value
FontStyle
Section titled “FontStyle”public FontStyle FontStyle { get; set; }
Property Value
FontWeight
Section titled “FontWeight”public FontWeight FontWeight { get; set; }
Property Value
Foreground
Section titled “Foreground”The brush used to render the BaseConnection.Text.
public Brush Foreground { get; set; }
Property Value
HasContextMenu
Section titled “HasContextMenu”Gets a value indicating whether the connection has a context menu.
public bool HasContextMenu { get; set; }
Property Value
HasCustomContextMenu
Section titled “HasCustomContextMenu”Gets or sets a value indicating whether the connection uses a custom context menu.
public bool HasCustomContextMenu { get; set; }
Property Value
IsAnimatingDirectionalArrows
Section titled “IsAnimatingDirectionalArrows”Gets or sets whether the directional arrows should be flowing through the connection wire.
public bool IsAnimatingDirectionalArrows { get; set; }
Property Value
OutlineBrush
Section titled “OutlineBrush”The brush used to render the outline.
public Brush OutlineBrush { get; set; }
Property Value
OutlineThickness
Section titled “OutlineThickness”The thickness of the outline.
public double OutlineThickness { get; set; }
Property Value
PrioritizeBaseConnectionForSelection
Section titled “PrioritizeBaseConnectionForSelection”Whether to prioritize controls of type BaseConnection inside custom connections (connection wrappers) when setting the BaseConnection.IsSelectableProperty and BaseConnection.IsSelectedProperty attached properties.
public static bool PrioritizeBaseConnectionForSelection { get; set; }
Property Value
Source
Section titled “Source”Gets or sets the start point of this connection.
public Point Source { get; set; }
Property Value
SourceOffset
Section titled “SourceOffset”Gets or sets the offset from the BaseConnection.Source point.
public Size SourceOffset { get; set; }
Property Value
SourceOffsetMode
Section titled “SourceOffsetMode”Gets or sets the ConnectionOffsetMode to apply to the BaseConnection.Source when drawing the connection.
public ConnectionOffsetMode SourceOffsetMode { get; set; }
Property Value
SourceOrientation
Section titled “SourceOrientation”Gets or sets the orientation in which this connection is flowing.
public Orientation SourceOrientation { get; set; }
Property Value
Spacing
Section titled “Spacing”The distance between the start point and the where the angle breaks.
public double Spacing { get; set; }
Property Value
SplitCommand
Section titled “SplitCommand”Splits the connection. Triggered by Nodify.Interactivity.EditorGestures.ConnectionGestures.Split gesture. Parameter is the location where the splitting ocurred.
public ICommand SplitCommand { get; set; }
Property Value
Target
Section titled “Target”Gets or sets the end point of this connection.
public Point Target { get; set; }
Property Value
TargetOffset
Section titled “TargetOffset”Gets or sets the offset from the BaseConnection.Target point.
public Size TargetOffset { get; set; }
Property Value
TargetOffsetMode
Section titled “TargetOffsetMode”Gets or sets the ConnectionOffsetMode to apply to the BaseConnection.Target when drawing the connection.
public ConnectionOffsetMode TargetOffsetMode { get; set; }
Property Value
TargetOrientation
Section titled “TargetOrientation”Gets or sets the orientation in which this connection is flowing.
public Orientation TargetOrientation { get; set; }
Property Value
Gets or sets the text contents of the BaseConnection.
public string Text { get; set; }
Property Value
Methods
Section titled “Methods”DrawArrowGeometry(StreamGeometryContext, Point, Point, ConnectionDirection, ArrowHeadShape, Orientation)
Section titled “DrawArrowGeometry(StreamGeometryContext, Point, Point, ConnectionDirection, ArrowHeadShape, Orientation)”protected virtual void DrawArrowGeometry(StreamGeometryContext context, Point source, Point target, ConnectionDirection arrowDirection = 0, ArrowHeadShape shape = 0, Orientation orientation = 0);
Parameters
context
StreamGeometryContext
source
Point
target
Point
arrowDirection
ConnectionDirection
shape
ArrowHeadShape
orientation
Orientation
DrawDefaultArrowhead(StreamGeometryContext, Point, Point, ConnectionDirection, Orientation)
Section titled “DrawDefaultArrowhead(StreamGeometryContext, Point, Point, ConnectionDirection, Orientation)”protected virtual void DrawDefaultArrowhead(StreamGeometryContext context, Point source, Point target, ConnectionDirection arrowDirection = 0, Orientation orientation = 0);
Parameters
context
StreamGeometryContext
source
Point
target
Point
arrowDirection
ConnectionDirection
orientation
Orientation
DrawDirectionalArrowheadGeometry(StreamGeometryContext, Vector, Point)
Section titled “DrawDirectionalArrowheadGeometry(StreamGeometryContext, Vector, Point)”protected virtual void DrawDirectionalArrowheadGeometry(StreamGeometryContext context, Vector direction, Point location);
Parameters
context
StreamGeometryContext
direction
Vector
location
Point
DrawDirectionalArrowsGeometry(StreamGeometryContext, Point, Point)
Section titled “DrawDirectionalArrowsGeometry(StreamGeometryContext, Point, Point)”protected virtual void DrawDirectionalArrowsGeometry(StreamGeometryContext context, Point source, Point target);
Parameters
context
StreamGeometryContext
source
Point
target
Point
DrawEllipseArrowhead(StreamGeometryContext, Point, Point, ConnectionDirection, Orientation)
Section titled “DrawEllipseArrowhead(StreamGeometryContext, Point, Point, ConnectionDirection, Orientation)”protected virtual void DrawEllipseArrowhead(StreamGeometryContext context, Point source, Point target, ConnectionDirection arrowDirection = 0, Orientation orientation = 0);
Parameters
context
StreamGeometryContext
source
Point
target
Point
arrowDirection
ConnectionDirection
orientation
Orientation
DrawLineGeometry(StreamGeometryContext, Point, Point)
Section titled “DrawLineGeometry(StreamGeometryContext, Point, Point)”protected virtual ValueTuple<ValueTuple<Point, Point>, ValueTuple<Point, Point>> DrawLineGeometry(StreamGeometryContext context, Point source, Point target);
Parameters
context
StreamGeometryContext
source
Point
target
Point
Returns
ValueTuple<ValueTuple<Point, Point>, ValueTuple<Point, Point>>
DrawRectangleArrowhead(StreamGeometryContext, Point, Point, ConnectionDirection, Orientation)
Section titled “DrawRectangleArrowhead(StreamGeometryContext, Point, Point, ConnectionDirection, Orientation)”protected virtual void DrawRectangleArrowhead(StreamGeometryContext context, Point source, Point target, ConnectionDirection arrowDirection = 0, Orientation orientation = 0);
Parameters
context
StreamGeometryContext
source
Point
target
Point
arrowDirection
ConnectionDirection
orientation
Orientation
GetIsSelectable(UIElement)
Section titled “GetIsSelectable(UIElement)”public static bool GetIsSelectable(UIElement elem);
Parameters
elem
UIElement
Returns
GetIsSelected(UIElement)
Section titled “GetIsSelected(UIElement)”public static bool GetIsSelected(UIElement elem);
Parameters
elem
UIElement
Returns
GetOffset()
Section titled “GetOffset()”Gets the resulting offset after applying the BaseConnection.SourceOffsetMode.
protected virtual ValueTuple<Vector, Vector> GetOffset();
Returns
GetTextPosition(FormattedText, Point, Point)
Section titled “GetTextPosition(FormattedText, Point, Point)”protected virtual Point GetTextPosition(FormattedText text, Point source, Point target);
Parameters
text
FormattedText
source
Point
target
Point
Returns
OnKeyDown(KeyEventArgs)
Section titled “OnKeyDown(KeyEventArgs)”protected override void OnKeyDown(KeyEventArgs e);
Parameters
OnKeyUp(KeyEventArgs)
Section titled “OnKeyUp(KeyEventArgs)”protected override void OnKeyUp(KeyEventArgs e);
Parameters
OnLostMouseCapture(MouseEventArgs)
Section titled “OnLostMouseCapture(MouseEventArgs)”protected override void OnLostMouseCapture(MouseEventArgs e);
Parameters
OnMouseDown(MouseButtonEventArgs)
Section titled “OnMouseDown(MouseButtonEventArgs)”protected override void OnMouseDown(MouseButtonEventArgs e);
Parameters
OnMouseMove(MouseEventArgs)
Section titled “OnMouseMove(MouseEventArgs)”protected override void OnMouseMove(MouseEventArgs e);
Parameters
OnMouseUp(MouseButtonEventArgs)
Section titled “OnMouseUp(MouseButtonEventArgs)”protected override void OnMouseUp(MouseButtonEventArgs e);
Parameters
OnMouseWheel(MouseWheelEventArgs)
Section titled “OnMouseWheel(MouseWheelEventArgs)”protected override void OnMouseWheel(MouseWheelEventArgs e);
Parameters
OnRender(DrawingContext)
Section titled “OnRender(DrawingContext)”protected override void OnRender(DrawingContext drawingContext);
Parameters
drawingContext
DrawingContext
Remove()
Section titled “Remove()”Removes the connection.
public void Remove();
SetIsSelectable(UIElement, Boolean)
Section titled “SetIsSelectable(UIElement, Boolean)”public static void SetIsSelectable(UIElement elem, bool value);
Parameters
elem
UIElement
value
Boolean
SetIsSelected(UIElement, Boolean)
Section titled “SetIsSelected(UIElement, Boolean)”public static void SetIsSelected(UIElement elem, bool value);
Parameters
elem
UIElement
value
Boolean
SplitAtLocation(Point)
Section titled “SplitAtLocation(Point)”Splits the connection at the specified location.
public void SplitAtLocation(Point splitLocation);
Parameters
splitLocation
Point: The Point where the connection should be split.
StartAnimation(Double)
Section titled “StartAnimation(Double)”Starts animating the directional arrows.
public void StartAnimation(double duration = 1.5d);
Parameters
duration
Double: The duration for moving an arrowhead from BaseConnection.Source to BaseConnection.Target.
StopAnimation()
Section titled “StopAnimation()”Stops the animation started by Nodify.BaseConnection.StartAnimation(System.Double)
public void StopAnimation();
Events
Section titled “Events”Disconnect
Section titled “Disconnect”Triggered by the Nodify.Interactivity.EditorGestures.ConnectionGestures.Disconnect gesture.
public event ConnectionEventHandler Disconnect;
Event Type
Triggered by the Nodify.Interactivity.EditorGestures.ConnectionGestures.Split gesture.
public event ConnectionEventHandler Split;
Event Type