Skip to content

PendingConnection

Namespace: Nodify

Assembly: Nodify

Inheritance: ObjectDispatcherObjectDependencyObjectVisualUIElementFrameworkElementControlContentControlPendingConnection

References: ConnectionDirection, Connector, HotKeysDisplayMode, ItemContainer, NodifyEditor, PendingConnectionEventArgs, PendingConnectionEventHandler, StateNode

Represents a pending connection usually started by a Connector which invokes the PendingConnection.CompletedCommand when completed.

public class PendingConnection : ContentControl
public PendingConnection();

If true will preview and connect only to Connectors, otherwise will also enable ItemContainers.

public bool AllowOnlyConnectors { get; set; }

Property Value

Boolean

Gets or sets the command to invoke when the pending connection is completed. Will not be invoked if NodifyEditor.ConnectionCompletedCommand is used. PendingConnection.Target will be set to the desired Connector’s FrameworkElement.DataContext and will also be the command’s parameter.

public ICommand CompletedCommand { get; set; }

Property Value

ICommand

Gets or sets the direction of this connection.

public ConnectionDirection Direction { get; set; }

Property Value

ConnectionDirection

Gets the NodifyEditor that owns this PendingConnection.

protected NodifyEditor Editor { get; set; }

Property Value

NodifyEditor

Gets or sets whether hit testing is enabled for pending connections.

public static bool EnableHitTesting { get; set; }

Property Value

Boolean

PendingConnection.PreviewTarget will be updated with a potential Connector’s FrameworkElement.DataContext if this is true.

public bool EnablePreview { get; set; }

Property Value

Boolean

Enables snapping the PendingConnection.TargetAnchor to a possible PendingConnection.Target connector.

public bool EnableSnapping { get; set; }

Property Value

Boolean

Gets or sets whether hotkeys are enabled for pending connections.

public static HotKeysDisplayMode HotKeysDisplayMode { get; set; }

Property Value

HotKeysDisplayMode

Gets or sets the visibility of the connection.

public bool IsVisible { get; set; }

Property Value

Boolean

Gets or sets the maximum number of hotkeys that can be displayed for a pending connection.

public static uint MaxHotKeys { get; set; }

Property Value

UInt32

Gets or sets the Connector or the ItemContainer (if PendingConnection.AllowOnlyConnectors is false) that we’re previewing. See PendingConnection.EnablePreview.

public object PreviewTarget { get; set; }

Property Value

Object

Gets or sets the Connector’s FrameworkElement.DataContext that started this pending connection.

public object Source { get; set; }

Property Value

Object

Gets or sets the starting point for the connection.

public Point SourceAnchor { get; set; }

Property Value

Point

Gets or sets the command to invoke when the pending connection is started. Will not be invoked if NodifyEditor.ConnectionStartedCommand is used. PendingConnection.Source will be set to the Connector’s FrameworkElement.DataContext that started this connection and will also be the command’s parameter.

public ICommand StartedCommand { get; set; }

Property Value

ICommand

Gets or sets the stroke color of the connection.

public Brush Stroke { get; set; }

Property Value

Brush

Gets or sets the pattern of dashes and gaps that is used to outline the connection.

public DoubleCollection StrokeDashArray { get; set; }

Property Value

DoubleCollection

Gets or set the connection thickness.

public double StrokeThickness { get; set; }

Property Value

Double

Gets or sets the Connector’s FrameworkElement.DataContext (or potentially an ItemContainer’s FrameworkElement.DataContext if PendingConnection.AllowOnlyConnectors is false) that the PendingConnection.Source can connect to. Only set when the connection is completed (see PendingConnection.CompletedCommand).

public object Target { get; set; }

Property Value

Object

Gets or sets the end point for the connection.

public Point TargetAnchor { get; set; }

Property Value

Point

Searches for a potential Connector or ItemContainer at the specified position within the editor.

public FrameworkElement FindConnectionTarget(Point position);

Parameters

position Point

Returns

FrameworkElement

public static bool GetIsOverElement(UIElement elem);

Parameters

elem UIElement

Returns

Boolean

public override void OnApplyTemplate();

OnPendingConnectionCompleted(Object, PendingConnectionEventArgs)

Section titled “OnPendingConnectionCompleted(Object, PendingConnectionEventArgs)”
protected virtual void OnPendingConnectionCompleted(object sender, PendingConnectionEventArgs e);

Parameters

sender Object

e PendingConnectionEventArgs

OnPendingConnectionDrag(Object, PendingConnectionEventArgs)

Section titled “OnPendingConnectionDrag(Object, PendingConnectionEventArgs)”
protected virtual void OnPendingConnectionDrag(object sender, PendingConnectionEventArgs e);

Parameters

sender Object

e PendingConnectionEventArgs

OnPendingConnectionStarted(Object, PendingConnectionEventArgs)

Section titled “OnPendingConnectionStarted(Object, PendingConnectionEventArgs)”
protected virtual void OnPendingConnectionStarted(object sender, PendingConnectionEventArgs e);

Parameters

sender Object

e PendingConnectionEventArgs

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

Parameters

elem UIElement

value Boolean