-
-
Notifications
You must be signed in to change notification settings - Fork 234
Nodify_Connector
Namespace: Nodify
Assembly: Nodify
Inheritance: Object → DispatcherObject → DependencyObject → Visual → UIElement → FrameworkElement → Control → Connector
Derived: NodeInput, NodeOutput, StateNode
References: ConnectorState.Connecting, Connection, ConnectorEventArgs, ConnectorEventHandler, ConnectorState.Default, ConnectorState.Disconnect, InputProcessor, ItemContainer, KnotNode, Node, NodifyEditor, PendingConnection, PendingConnectionEventArgs, PendingConnectionEventHandler
Represents a connector control that can start and complete a PendingConnection. Has a Connector.ElementConnector that the Connector.Anchor is calculated from for the PendingConnection. Center of this control is used if missing.
public class Connector : Control
public Connector();
protected const string ElementConnector = "PART_Connector";
Field Value
Gets or sets if Connectors should enable optimizations based on Connector.OptimizeSafeZone and Connector.OptimizeMinimumSelectedItems.
public static bool EnableOptimizations;
Field Value
Gets or sets the minimum selected items needed to trigger optimizations when outside of the Connector.OptimizeSafeZone.
public static uint OptimizeMinimumSelectedItems;
Field Value
Gets or sets the safe zone outside the editor's viewport that will not trigger optimizations.
public static double OptimizeSafeZone;
Field Value
Gets or sets whether cancelling a pending connection is allowed.
public static bool AllowPendingConnectionCancellation { get; set; }
Property Value
Gets the location in graph space coordinates where Connections can be attached to. Bind with System.Windows.Data.BindingMode.OneWayToSource
public Point Anchor { get; set; }
Property Value
Gets the ItemContainer that contains this Connector.
public ItemContainer Container { get; set; }
Property Value
Invoked if the Connector.Disconnect event is not handled. Parameter is the FrameworkElement.DataContext of this control.
public ICommand DisconnectCommand { get; set; }
Property Value
Gets the NodifyEditor that owns this Connector.Container.
public NodifyEditor Editor { get; set; }
Property Value
Gets a value indicating whether the connector has a context menu.
public bool HasContextMenu { get; set; }
Property Value
Gets or sets a value indicating whether the connector uses a custom context menu.
public bool HasCustomContextMenu { get; set; }
Property Value
protected InputProcessor InputProcessor { get; set; }
Property Value
If this is set to false, the Connector.Disconnect event will not be invoked and the connector will stop updating its Connector.Anchor when moved, resized etc.
public bool IsConnected { get; set; }
Property Value
Gets a value that indicates whether a PendingConnection is in progress for this Connector.
public bool IsPendingConnection { get; protected set; }
Property Value
Initiates a new pending connection from this connector with the specified offset (see Connector.IsPendingConnection).
public void BeginConnecting();
public void BeginConnecting(Vector offset);
Parameters
offset
Vector
Cancels the current pending connection without completing it if Connector.AllowPendingConnectionCancellation is true. Otherwise, it completes the pending connection by calling Nodify.Connector.EndConnecting.
public void CancelConnecting();
Completes the current pending connection using the specified connector as the target.
public void EndConnecting();
public void EndConnecting(Connector connector);
Parameters
connector
Connector
Searches for a potential Connector or ItemContainer at the specified position within the editor.
public FrameworkElement FindConnectionTarget(Point position);
Parameters
position
Point: The position in the editor to check for a potential connection target.
Returns
Searches for a Connector at the specified position.
public Connector FindTargetConnector(Point position);
Parameters
position
Point: The position in the editor to check for a connector.
Returns
public override void OnApplyTemplate();
protected override void OnKeyDown(KeyEventArgs e);
Parameters
protected override void OnKeyUp(KeyEventArgs e);
Parameters
protected override void OnLostMouseCapture(MouseEventArgs e);
Parameters
protected override void OnMouseDown(MouseButtonEventArgs e);
Parameters
protected override void OnMouseMove(MouseEventArgs e);
Parameters
protected override void OnMouseUp(MouseButtonEventArgs e);
Parameters
protected override void OnMouseWheel(MouseWheelEventArgs e);
Parameters
protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo);
Parameters
sizeInfo
SizeChangedInfo
Removes all connections associated with this connector.
public void RemoveConnections();
Updates the Connector.Anchor relative to a location. (usually Connector.Container's location)
protected void UpdateAnchor(Point location);
Parameters
location
Point: The relative location
Updates the Connector.Anchor based on Connector.Container's location.
public void UpdateAnchor();
Updates the Connector.Anchor and applies optimizations if needed based on Connector.EnableOptimizations flag
protected void UpdateAnchorOptimized(Point location);
Parameters
location
Point
Updates the endpoint of the pending connection by adjusting its position with the specified offset.
public void UpdatePendingConnection(Vector offset);
Parameters
offset
Vector: The amount to adjust the pending connection's endpoint.
Updates the endpoint of the pending connection to the specified position.
public void UpdatePendingConnection(Point position);
Parameters
position
Point: The new position for the connection's endpoint.
Triggered by the Nodify.Interactivity.EditorGestures.ConnectorGestures.Disconnect gesture.
public event ConnectorEventHandler Disconnect;
Event Type
Triggered by the Nodify.Interactivity.EditorGestures.ConnectorGestures.Connect gesture.
public event PendingConnectionEventHandler PendingConnectionCompleted;
Event Type
Occurs when the mouse is changing position and the Connector has mouse capture.
public event PendingConnectionEventHandler PendingConnectionDrag;
Event Type
Triggered by the Nodify.Interactivity.EditorGestures.ConnectorGestures.Connect gesture.
public event PendingConnectionEventHandler PendingConnectionStarted;
Event Type