-
-
Notifications
You must be signed in to change notification settings - Fork 230
Nodify_BaseConnection
Namespace: Nodify
Assembly: Nodify
Inheritance: Object → DispatcherObject → DependencyObject → Visual → UIElement → FrameworkElement → Shape → BaseConnection
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
protected BaseConnection();
Gets a vector that has its coordinates set to 0.
protected static Vector ZeroVector;
Field Value
Gets or sets the arrowhead ends.
public ArrowHeadEnds ArrowEnds { get; set; }
Property Value
Gets or sets the arrowhead ends.
public ArrowHeadShape ArrowShape { get; set; }
Property Value
Gets or sets the size of the arrow head.
public Size ArrowSize { get; set; }
Property Value
protected override Geometry DefiningGeometry { get; set; }
Property Value
Gets or sets the direction in which this connection is flowing.
public ConnectionDirection Direction { get; set; }
Property Value
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
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
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
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
public FontFamily FontFamily { get; set; }
Property Value
public double FontSize { get; set; }
Property Value
public FontStretch FontStretch { get; set; }
Property Value
public FontStyle FontStyle { get; set; }
Property Value
public FontWeight FontWeight { get; set; }
Property Value
The brush used to render the BaseConnection.Text.
public Brush Foreground { get; set; }
Property Value
Gets a value indicating whether the connection has a context menu.
public bool HasContextMenu { get; set; }
Property Value
Gets or sets a value indicating whether the connection uses a custom context menu.
public bool HasCustomContextMenu { get; set; }
Property Value
Gets or sets whether the directional arrows should be flowing through the connection wire.
public bool IsAnimatingDirectionalArrows { get; set; }
Property Value
The brush used to render the outline.
public Brush OutlineBrush { get; set; }
Property Value
The thickness of the outline.
public double OutlineThickness { get; set; }
Property Value
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
Gets or sets the start point of this connection.
public Point Source { get; set; }
Property Value
Gets or sets the offset from the BaseConnection.Source point.
public Size SourceOffset { get; set; }
Property Value
Gets or sets the ConnectionOffsetMode to apply to the BaseConnection.Source when drawing the connection.
public ConnectionOffsetMode SourceOffsetMode { get; set; }
Property Value
Gets or sets the orientation in which this connection is flowing.
public Orientation SourceOrientation { get; set; }
Property Value
The distance between the start point and the where the angle breaks.
public double Spacing { get; set; }
Property Value
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
Gets or sets the end point of this connection.
public Point Target { get; set; }
Property Value
Gets or sets the offset from the BaseConnection.Target point.
public Size TargetOffset { get; set; }
Property Value
Gets or sets the ConnectionOffsetMode to apply to the BaseConnection.Target when drawing the connection.
public ConnectionOffsetMode TargetOffsetMode { get; set; }
Property Value
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
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
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
protected virtual void DrawDirectionalArrowheadGeometry(StreamGeometryContext context, Vector direction, Point location);
Parameters
context
StreamGeometryContext
direction
Vector
location
Point
protected virtual void DrawDirectionalArrowsGeometry(StreamGeometryContext context, Point source, Point target);
Parameters
context
StreamGeometryContext
source
Point
target
Point
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
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>>
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
public static bool GetIsSelected(UIElement elem);
Parameters
elem
UIElement
Returns
Gets the resulting offset after applying the BaseConnection.SourceOffsetMode.
protected virtual ValueTuple<Vector, Vector> GetOffset();
Returns
protected virtual Point GetTextPosition(FormattedText text, Point source, Point target);
Parameters
text
FormattedText
source
Point
target
Point
Returns
protected override void OnKeyDown(KeyEventArgs e);
Parameters
protected override void OnKeyUp(KeyEventArgs e);
Parameters
protected override void OnLostMouseCapture(MouseEventArgs e);
Parameters
protected override void OnMouseDown(MouseButtonEventArgs e);
Parameters
protected override void OnMouseMove(MouseEventArgs e);
Parameters
protected override void OnMouseUp(MouseButtonEventArgs e);
Parameters
protected override void OnMouseWheel(MouseWheelEventArgs e);
Parameters
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
Triggered by the Nodify.Interactivity.EditorGestures.ConnectionGestures.Split gesture.
public event ConnectionEventHandler Split;
Event Type