11 KiB
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
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
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
Gets or sets the direction of this connection.
public ConnectionDirection Direction { get; set; }
Property Value
Editor
Gets the NodifyEditor that owns this PendingConnection.
protected NodifyEditor Editor { get; set; }
Property Value
EnableHitTesting
Gets or sets whether hit testing is enabled for pending connections.
public static bool EnableHitTesting { get; set; }
Property Value
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
Enables snapping the PendingConnection.TargetAnchor to a possible PendingConnection.Target connector.
public bool EnableSnapping { get; set; }
Property Value
HotKeysDisplayMode
Gets or sets whether hotkeys are enabled for pending connections.
public static HotKeysDisplayMode HotKeysDisplayMode { get; set; }
Property Value
IsVisible
Gets or sets the visibility of the connection.
public bool IsVisible { get; set; }
Property Value
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
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
Gets or sets the Connector's FrameworkElement.DataContext that started this pending connection.
public object Source { get; set; }
Property Value
SourceAnchor
Gets or sets the starting point for the connection.
public Point SourceAnchor { get; set; }
Property Value
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
Gets or sets the stroke color of the connection.
public Brush Stroke { get; set; }
Property Value
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
Gets or set the connection thickness.
public double StrokeThickness { get; set; }
Property Value
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
Gets or sets the end point for the connection.
public Point TargetAnchor { get; set; }
Property Value
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
GetIsOverElement(UIElement)
public static bool GetIsOverElement(UIElement elem);
Parameters
elem UIElement
Returns
OnApplyTemplate()
public override void OnApplyTemplate();
OnPendingConnectionCompleted(Object, PendingConnectionEventArgs)
protected virtual void OnPendingConnectionCompleted(object sender, PendingConnectionEventArgs e);
Parameters
sender Object
OnPendingConnectionDrag(Object, PendingConnectionEventArgs)
protected virtual void OnPendingConnectionDrag(object sender, PendingConnectionEventArgs e);
Parameters
sender Object
OnPendingConnectionStarted(Object, PendingConnectionEventArgs)
protected virtual void OnPendingConnectionStarted(object sender, PendingConnectionEventArgs e);
Parameters
sender Object
SetIsOverElement(UIElement, Boolean)
public static void SetIsOverElement(UIElement elem, bool value);
Parameters
elem UIElement
value Boolean