Skip to content

BaseConnection

Namespace: Nodify

Assembly: Nodify

Inheritance: ObjectDispatcherObjectDependencyObjectVisualUIElementFrameworkElementShapeBaseConnection

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>
protected BaseConnection();

Gets a vector that has its coordinates set to 0.

protected static Vector ZeroVector;

Field Value

Vector

Gets or sets the arrowhead ends.

public ArrowHeadEnds ArrowEnds { get; set; }

Property Value

ArrowHeadEnds

Gets or sets the arrowhead ends.

public ArrowHeadShape ArrowShape { get; set; }

Property Value

ArrowHeadShape

Gets or sets the size of the arrow head.

public Size ArrowSize { get; set; }

Property Value

Size

protected override Geometry DefiningGeometry { get; set; }

Property Value

Geometry

Gets or sets the direction in which this connection is flowing.

public ConnectionDirection Direction { get; set; }

Property Value

ConnectionDirection

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

Double

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

UInt32

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

Double

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

ICommand

The space between the focus visual and the connection geometry.

public double FocusVisualPadding { get; set; }

Property Value

Double

The pen used to render the focus visual.

public Pen FocusVisualPen { get; set; }

Property Value

Pen

The key used to retrieve the BaseConnection.FocusVisualPen resource.

public static ResourceKey FocusVisualPenKey { get; set; }

Property Value

ResourceKey

public FontFamily FontFamily { get; set; }

Property Value

FontFamily

public double FontSize { get; set; }

Property Value

Double

public FontStretch FontStretch { get; set; }

Property Value

FontStretch

public FontStyle FontStyle { get; set; }

Property Value

FontStyle

public FontWeight FontWeight { get; set; }

Property Value

FontWeight

The brush used to render the BaseConnection.Text.

public Brush Foreground { get; set; }

Property Value

Brush

Gets a value indicating whether the connection has a context menu.

public bool HasContextMenu { get; set; }

Property Value

Boolean

Gets or sets a value indicating whether the connection uses a custom context menu.

public bool HasCustomContextMenu { get; set; }

Property Value

Boolean

Gets or sets whether the directional arrows should be flowing through the connection wire.

public bool IsAnimatingDirectionalArrows { get; set; }

Property Value

Boolean

The brush used to render the outline.

public Brush OutlineBrush { get; set; }

Property Value

Brush

The thickness of the outline.

public double OutlineThickness { get; set; }

Property Value

Double

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

Boolean

Gets or sets the start point of this connection.

public Point Source { get; set; }

Property Value

Point

Gets or sets the offset from the BaseConnection.Source point.

public Size SourceOffset { get; set; }

Property Value

Size

Gets or sets the ConnectionOffsetMode to apply to the BaseConnection.Source when drawing the connection.

public ConnectionOffsetMode SourceOffsetMode { get; set; }

Property Value

ConnectionOffsetMode

Gets or sets the orientation in which this connection is flowing.

public Orientation SourceOrientation { get; set; }

Property Value

Orientation

The distance between the start point and the where the angle breaks.

public double Spacing { get; set; }

Property Value

Double

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

ICommand

Gets or sets the end point of this connection.

public Point Target { get; set; }

Property Value

Point

Gets or sets the offset from the BaseConnection.Target point.

public Size TargetOffset { get; set; }

Property Value

Size

Gets or sets the ConnectionOffsetMode to apply to the BaseConnection.Target when drawing the connection.

public ConnectionOffsetMode TargetOffsetMode { get; set; }

Property Value

ConnectionOffsetMode

Gets or sets the orientation in which this connection is flowing.

public Orientation TargetOrientation { get; set; }

Property Value

Orientation

Gets or sets the text contents of the BaseConnection.

public string Text { get; set; }

Property Value

String

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

public static bool GetIsSelectable(UIElement elem);

Parameters

elem UIElement

Returns

Boolean

public static bool GetIsSelected(UIElement elem);

Parameters

elem UIElement

Returns

Boolean

Gets the resulting offset after applying the BaseConnection.SourceOffsetMode.

protected virtual ValueTuple<Vector, Vector> GetOffset();

Returns

ValueTuple<Vector, Vector>

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

Point

protected override void OnKeyDown(KeyEventArgs e);

Parameters

e KeyEventArgs

protected override void OnKeyUp(KeyEventArgs e);

Parameters

e KeyEventArgs

protected override void OnLostMouseCapture(MouseEventArgs e);

Parameters

e MouseEventArgs

protected override void OnMouseDown(MouseButtonEventArgs e);

Parameters

e MouseButtonEventArgs

protected override void OnMouseMove(MouseEventArgs e);

Parameters

e MouseEventArgs

protected override void OnMouseUp(MouseButtonEventArgs e);

Parameters

e MouseButtonEventArgs

protected override void OnMouseWheel(MouseWheelEventArgs e);

Parameters

e MouseWheelEventArgs

protected override void OnRender(DrawingContext drawingContext);

Parameters

drawingContext DrawingContext

Removes the connection.

public void Remove();
public static void SetIsSelectable(UIElement elem, bool value);

Parameters

elem UIElement

value Boolean

public static void SetIsSelected(UIElement elem, bool value);

Parameters

elem UIElement

value Boolean

Splits the connection at the specified location.

public void SplitAtLocation(Point splitLocation);

Parameters

splitLocation Point: The Point where the connection should be split.

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.

Stops the animation started by Nodify.BaseConnection.StartAnimation(System.Double)

public void StopAnimation();

Triggered by the Nodify.Interactivity.EditorGestures.ConnectionGestures.Disconnect gesture.

public event ConnectionEventHandler Disconnect;

Event Type

ConnectionEventHandler

Triggered by the Nodify.Interactivity.EditorGestures.ConnectionGestures.Split gesture.

public event ConnectionEventHandler Split;

Event Type

ConnectionEventHandler