-
-
Notifications
You must be signed in to change notification settings - Fork 230
Nodify_PendingConnection
Namespace: Nodify
Assembly: Nodify
Inheritance: Object → DispatcherObject → DependencyObject → Visual → UIElement → FrameworkElement → Control → ContentControl → PendingConnection
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
public PendingConnection();
If true will preview and connect only to Connectors, otherwise will also enable ItemContainers.
public bool AllowOnlyConnectors { get; set; }
Property Value
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
Gets or sets the direction of this connection.
public ConnectionDirection Direction { get; set; }
Property Value
Gets the NodifyEditor that owns this PendingConnection.
protected NodifyEditor Editor { get; set; }
Property Value
Gets or sets whether hit testing is enabled for pending connections.
public static bool EnableHitTesting { get; set; }
Property Value
PendingConnection.PreviewTarget will be updated with a potential Connector's FrameworkElement.DataContext if this is true.
public bool EnablePreview { get; set; }
Property Value
Enables snapping the PendingConnection.TargetAnchor to a possible PendingConnection.Target connector.
public bool EnableSnapping { get; set; }
Property Value
Gets or sets the visibility of the connection.
public bool IsVisible { get; set; }
Property Value
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
Gets or sets the Connector's FrameworkElement.DataContext that started this pending connection.
public object Source { get; set; }
Property Value
Gets or sets the starting point for the connection.
public Point SourceAnchor { get; set; }
Property Value
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
Gets or sets the stroke color of the connection.
public Brush Stroke { get; set; }
Property Value
Gets or sets the pattern of dashes and gaps that is used to outline the connection.
public DoubleCollection StrokeDashArray { get; set; }
Property Value
Gets or set the connection thickness.
public double StrokeThickness { get; set; }
Property Value
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
Gets or sets the end point for the connection.
public Point TargetAnchor { get; set; }
Property Value
Searches for a potential Connector or ItemContainer at the specified position within the editor.
public FrameworkElement FindConnectionTarget(Point position);
Parameters
position
Point
Returns
public static bool GetIsOverElement(UIElement elem);
Parameters
elem
UIElement
Returns
public override void OnApplyTemplate();
protected virtual void OnPendingConnectionCompleted(object sender, PendingConnectionEventArgs e);
Parameters
sender
Object
protected virtual void OnPendingConnectionDrag(object sender, PendingConnectionEventArgs e);
Parameters
sender
Object
protected virtual void OnPendingConnectionStarted(object sender, PendingConnectionEventArgs e);
Parameters
sender
Object
public static void SetIsOverElement(UIElement elem, bool value);
Parameters
elem
UIElement
value
Boolean