Skip to content

Nodify_PendingConnection

miroiu edited this page Dec 23, 2024 · 1 revision

PendingConnection Class

Namespace: Nodify

Assembly: Nodify

Inheritance: ObjectDispatcherObjectDependencyObjectVisualUIElementFrameworkElementControlContentControlPendingConnection

References: ConnectionDirection, Connector, 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  

Constructors

PendingConnection()

public PendingConnection();  

Properties

AllowOnlyConnectors

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

public bool AllowOnlyConnectors { get; set; }  

Property Value

Boolean

CompletedCommand

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

Direction

Gets or sets the direction of this connection.

public ConnectionDirection Direction { get; set; }  

Property Value

ConnectionDirection

Editor

Gets the NodifyEditor that owns this PendingConnection.

protected NodifyEditor Editor { get; set; }  

Property Value

NodifyEditor

EnableHitTesting

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

public static bool EnableHitTesting { get; set; }  

Property Value

Boolean

EnablePreview

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

public bool EnablePreview { get; set; }  

Property Value

Boolean

EnableSnapping

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

public bool EnableSnapping { get; set; }  

Property Value

Boolean

IsVisible

Gets or sets the visibility of the connection.

public bool IsVisible { get; set; }  

Property Value

Boolean

PreviewTarget

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

Source

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

public object Source { get; set; }  

Property Value

Object

SourceAnchor

Gets or sets the starting point for the connection.

public Point SourceAnchor { get; set; }  

Property Value

Point

StartedCommand

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

Stroke

Gets or sets the stroke color of the connection.

public Brush Stroke { get; set; }  

Property Value

Brush

StrokeDashArray

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

public DoubleCollection StrokeDashArray { get; set; }  

Property Value

DoubleCollection

StrokeThickness

Gets or set the connection thickness.

public double StrokeThickness { get; set; }  

Property Value

Double

Target

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

TargetAnchor

Gets or sets the end point for the connection.

public Point TargetAnchor { get; set; }  

Property Value

Point

Methods

FindConnectionTarget(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

GetIsOverElement(UIElement)

public static bool GetIsOverElement(UIElement elem);  

Parameters

elem UIElement

Returns

Boolean

OnApplyTemplate()

public override void OnApplyTemplate();  

OnPendingConnectionCompleted(Object, PendingConnectionEventArgs)

protected virtual void OnPendingConnectionCompleted(object sender, PendingConnectionEventArgs e);  

Parameters

sender Object

e PendingConnectionEventArgs

OnPendingConnectionDrag(Object, PendingConnectionEventArgs)

protected virtual void OnPendingConnectionDrag(object sender, PendingConnectionEventArgs e);  

Parameters

sender Object

e PendingConnectionEventArgs

OnPendingConnectionStarted(Object, PendingConnectionEventArgs)

protected virtual void OnPendingConnectionStarted(object sender, PendingConnectionEventArgs e);  

Parameters

sender Object

e PendingConnectionEventArgs

SetIsOverElement(UIElement, Boolean)

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

Parameters

elem UIElement

value Boolean

Clone this wiki locally