PendingConnection
PendingConnection Class
Section titled “PendingConnection Class”Namespace: Nodify
Assembly: Nodify
Inheritance: Object → DispatcherObject → DependencyObject → Visual → UIElement → FrameworkElement → Control → ContentControl → PendingConnection
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
Constructors
Section titled “Constructors”PendingConnection()
Section titled “PendingConnection()”public PendingConnection();
Properties
Section titled “Properties”AllowOnlyConnectors
Section titled “AllowOnlyConnectors”If true will preview and connect only to Connectors, otherwise will also enable ItemContainers.
public bool AllowOnlyConnectors { get; set; }
Property Value
CompletedCommand
Section titled “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
Direction
Section titled “Direction”Gets or sets the direction of this connection.
public ConnectionDirection Direction { get; set; }
Property Value
Editor
Section titled “Editor”Gets the NodifyEditor that owns this PendingConnection.
protected NodifyEditor Editor { get; set; }
Property Value
EnableHitTesting
Section titled “EnableHitTesting”Gets or sets whether hit testing is enabled for pending connections.
public static bool EnableHitTesting { get; set; }
Property Value
EnablePreview
Section titled “EnablePreview”PendingConnection.PreviewTarget will be updated with a potential Connector’s FrameworkElement.DataContext if this is true.
public bool EnablePreview { get; set; }
Property Value
EnableSnapping
Section titled “EnableSnapping”Enables snapping the PendingConnection.TargetAnchor to a possible PendingConnection.Target connector.
public bool EnableSnapping { get; set; }
Property Value
HotKeysDisplayMode
Section titled “HotKeysDisplayMode”Gets or sets whether hotkeys are enabled for pending connections.
public static HotKeysDisplayMode HotKeysDisplayMode { get; set; }
Property Value
IsVisible
Section titled “IsVisible”Gets or sets the visibility of the connection.
public bool IsVisible { get; set; }
Property Value
MaxHotKeys
Section titled “MaxHotKeys”Gets or sets the maximum number of hotkeys that can be displayed for a pending connection.
public static uint MaxHotKeys { get; set; }
Property Value
PreviewTarget
Section titled “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
Source
Section titled “Source”Gets or sets the Connector’s FrameworkElement.DataContext that started this pending connection.
public object Source { get; set; }
Property Value
SourceAnchor
Section titled “SourceAnchor”Gets or sets the starting point for the connection.
public Point SourceAnchor { get; set; }
Property Value
StartedCommand
Section titled “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
Stroke
Section titled “Stroke”Gets or sets the stroke color of the connection.
public Brush Stroke { get; set; }
Property Value
StrokeDashArray
Section titled “StrokeDashArray”Gets or sets the pattern of dashes and gaps that is used to outline the connection.
public DoubleCollection StrokeDashArray { get; set; }
Property Value
StrokeThickness
Section titled “StrokeThickness”Gets or set the connection thickness.
public double StrokeThickness { get; set; }
Property Value
Target
Section titled “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
TargetAnchor
Section titled “TargetAnchor”Gets or sets the end point for the connection.
public Point TargetAnchor { get; set; }
Property Value
Methods
Section titled “Methods”FindConnectionTarget(Point)
Section titled “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
GetIsOverElement(UIElement)
Section titled “GetIsOverElement(UIElement)”public static bool GetIsOverElement(UIElement elem);
Parameters
elem
UIElement
Returns
OnApplyTemplate()
Section titled “OnApplyTemplate()”public override void OnApplyTemplate();
OnPendingConnectionCompleted(Object, PendingConnectionEventArgs)
Section titled “OnPendingConnectionCompleted(Object, PendingConnectionEventArgs)”protected virtual void OnPendingConnectionCompleted(object sender, PendingConnectionEventArgs e);
Parameters
sender
Object
OnPendingConnectionDrag(Object, PendingConnectionEventArgs)
Section titled “OnPendingConnectionDrag(Object, PendingConnectionEventArgs)”protected virtual void OnPendingConnectionDrag(object sender, PendingConnectionEventArgs e);
Parameters
sender
Object
OnPendingConnectionStarted(Object, PendingConnectionEventArgs)
Section titled “OnPendingConnectionStarted(Object, PendingConnectionEventArgs)”protected virtual void OnPendingConnectionStarted(object sender, PendingConnectionEventArgs e);
Parameters
sender
Object
SetIsOverElement(UIElement, Boolean)
Section titled “SetIsOverElement(UIElement, Boolean)”public static void SetIsOverElement(UIElement elem, bool value);
Parameters
elem
UIElement
value
Boolean