Skip to content

Nodify_NodifyEditor

miroiu edited this page Dec 23, 2024 · 1 revision

NodifyEditor Class

Namespace: Nodify

Assembly: Nodify

Inheritance: ObjectDispatcherObjectDependencyObjectVisualUIElementFrameworkElementControlItemsControlSelectorMultiSelectorNodifyEditor

Implements: IScrollInfo

References: Alignment, BaseConnection, Connection, Connector, EditorState.Cutting, CuttingLine, DecoratorContainer, EditorCommands, EditorGestures, GroupingNode, InputProcessor, ItemContainer, ItemsMovedEventArgs, ItemsMovedEventHandler, Minimap, EditorState.Panning, EditorState.PanningWithMouseWheel, PendingConnection, EditorState.PushingItems, EditorState.Selecting, SelectionType, EditorState.Zooming

Groups ItemContainers and Connections in an area that you can drag, zoom and select.

public class NodifyEditor : MultiSelector, IScrollInfo  

Constructors

NodifyEditor()

Initializes a new instance of the NodifyEditor class.

public NodifyEditor();  

Fields

CuttingConnectionTypes

The list of supported connection types for cutting. Type must be derived from FrameworkElement.

public static HashSet<Type> CuttingConnectionTypes;  

Field Value

HashSet<Type>

CuttingLineEndPropertyKey

protected static DependencyPropertyKey CuttingLineEndPropertyKey;  

Field Value

DependencyPropertyKey

CuttingLineStartPropertyKey

protected static DependencyPropertyKey CuttingLineStartPropertyKey;  

Field Value

DependencyPropertyKey

ElementConnectionsHost

protected const string ElementConnectionsHost = "PART_ConnectionsHost";  

Field Value

String

ElementItemsHost

protected const string ElementItemsHost = "PART_ItemsHost";  

Field Value

String

IsCuttingPropertyKey

protected static DependencyPropertyKey IsCuttingPropertyKey;  

Field Value

DependencyPropertyKey

IsDraggingPropertyKey

protected static DependencyPropertyKey IsDraggingPropertyKey;  

Field Value

DependencyPropertyKey

IsPanningPropertyKey

protected static DependencyPropertyKey IsPanningPropertyKey;  

Field Value

DependencyPropertyKey

IsPushingItemsPropertyKey

protected static DependencyPropertyKey IsPushingItemsPropertyKey;  

Field Value

DependencyPropertyKey

IsSelectingPropertyKey

protected static DependencyPropertyKey IsSelectingPropertyKey;  

Field Value

DependencyPropertyKey

PushedAreaOrientationPropertyKey

protected static DependencyPropertyKey PushedAreaOrientationPropertyKey;  

Field Value

DependencyPropertyKey

PushedAreaPropertyKey

protected static DependencyPropertyKey PushedAreaPropertyKey;  

Field Value

DependencyPropertyKey

ScaleTransform

Gets the transform used to zoom on the viewport.

protected readonly ScaleTransform ScaleTransform;  

Field Value

ScaleTransform

SelectedAreaPropertyKey

protected static DependencyPropertyKey SelectedAreaPropertyKey;  

Field Value

DependencyPropertyKey

TranslateTransform

Gets the transform used to offset the viewport.

protected readonly TranslateTransform TranslateTransform;  

Field Value

TranslateTransform

ViewportTransformPropertyKey

protected static DependencyPropertyKey ViewportTransformPropertyKey;  

Field Value

DependencyPropertyKey

Properties

AllowCuttingCancellation

Gets or sets whether cancelling a cutting operation is allowed (see Nodify.Interactivity.EditorGestures.NodifyEditorGestures.CancelAction).

public static bool AllowCuttingCancellation { get; set; }  

Property Value

Boolean

AllowDraggingCancellation

Gets or sets whether cancelling a dragging operation is allowed.

public static bool AllowDraggingCancellation { get; set; }  

Property Value

Boolean

AllowPanningCancellation

Gets or sets whether panning cancellation is allowed (see Nodify.Interactivity.EditorGestures.NodifyEditorGestures.CancelAction).

public static bool AllowPanningCancellation { get; set; }  

Property Value

Boolean

AllowPushItemsCancellation

Gets or sets whether push items cancellation is allowed (see Nodify.Interactivity.EditorGestures.NodifyEditorGestures.CancelAction).

public static bool AllowPushItemsCancellation { get; set; }  

Property Value

Boolean

AllowSelectionCancellation

Gets or sets whether cancelling a selection operation is allowed (see Nodify.Interactivity.EditorGestures.SelectionGestures.Cancel).

public static bool AllowSelectionCancellation { get; set; }  

Property Value

Boolean

AutoPanEdgeDistance

Gets or sets the maximum distance in pixels from the edge of the editor that will trigger auto-panning.

public double AutoPanEdgeDistance { get; set; }  

Property Value

Double

AutoPanningTickRate

Gets or sets how often the new NodifyEditor.ViewportLocation is calculated in milliseconds when NodifyEditor.DisableAutoPanning is false.

public static double AutoPanningTickRate { get; set; }  

Property Value

Double

AutoPanSpeed

Gets or sets the speed used when auto-panning scaled by NodifyEditor.AutoPanningTickRate

public double AutoPanSpeed { get; set; }  

Property Value

Double

BringIntoViewMaxDuration

Gets or sets the maximum animation duration in seconds for bringing a location into view.

public double BringIntoViewMaxDuration { get; set; }  

Property Value

Double

BringIntoViewSpeed

Gets or sets the animation speed in pixels per second for bringing a location into view.

public double BringIntoViewSpeed { get; set; }  

Property Value

Double

CanSelectMultipleConnections

Gets or sets whether multiple connections can be selected.

public bool CanSelectMultipleConnections { get; set; }  

Property Value

Boolean

CanSelectMultipleItems

Gets or sets whether multiple ItemContainers can be selected.

public bool CanSelectMultipleItems { get; set; }  

Property Value

Boolean

ConnectionCompletedCommand

Invoked when the PendingConnection is completed. Use PendingConnection.CompletedCommand if you want to control the visibility of the connection from the viewmodel. Parameter is System.Tuple2 where System.Tuple2.Item1 is the PendingConnection.Source and System.Tuple`2.Item2 is PendingConnection.Target.

public ICommand ConnectionCompletedCommand { get; set; }  

Property Value

ICommand

Connections

Gets or sets the data source that BaseConnections will be generated for.

public IEnumerable Connections { get; set; }  

Property Value

IEnumerable

ConnectionStartedCommand

Invoked when the PendingConnection is completed. Use PendingConnection.StartedCommand if you want to control the visibility of the connection from the viewmodel. Parameter is PendingConnection.Source.

public ICommand ConnectionStartedCommand { get; set; }  

Property Value

ICommand

ConnectionTemplate

Gets or sets the DataTemplate to use when generating a new BaseConnection.

public DataTemplate ConnectionTemplate { get; set; }  

Property Value

DataTemplate

CuttingCompletedCommand

Invoked when a cutting operation is completed.

public ICommand CuttingCompletedCommand { get; set; }  

Property Value

ICommand

CuttingLineEnd

Gets the end point of the CuttingLine while NodifyEditor.IsCutting is true.

public Point CuttingLineEnd { get; set; }  

Property Value

Point

CuttingLineStart

Gets the start point of the CuttingLine while NodifyEditor.IsCutting is true.

public Point CuttingLineStart { get; set; }  

Property Value

Point

CuttingLineStyle

Gets or sets the style to use for the cutting line.

public Style CuttingLineStyle { get; set; }  

Property Value

Style

CuttingStartedCommand

Invoked when a cutting operation is started.

public ICommand CuttingStartedCommand { get; set; }  

Property Value

ICommand

DecoratorContainerStyle

Gets or sets the style to use for the DecoratorContainer.

public Style DecoratorContainerStyle { get; set; }  

Property Value

Style

Decorators

Gets or sets the items that will be rendered in the decorators layer via DecoratorContainers.

public IEnumerable Decorators { get; set; }  

Property Value

IEnumerable

DecoratorsExtent

The area covered by the DecoratorContainers.

public Rect DecoratorsExtent { get; set; }  

Property Value

Rect

DecoratorTemplate

Gets or sets the DataTemplate to use when generating a new DecoratorContainer.

public DataTemplate DecoratorTemplate { get; set; }  

Property Value

DataTemplate

DisableAutoPanning

Gets or sets whether to disable the auto panning when selecting or dragging near the edge of the editor configured by NodifyEditor.AutoPanEdgeDistance.

public bool DisableAutoPanning { get; set; }  

Property Value

Boolean

DisablePanning

Gets or sets whether panning should be disabled.

public bool DisablePanning { get; set; }  

Property Value

Boolean

DisableZooming

Gets or sets whether zooming should be disabled.

public bool DisableZooming { get; set; }  

Property Value

Boolean

DisconnectConnectorCommand

Invoked when the Connector.Disconnect event is raised. Can also be handled at the Connector level using the Connector.DisconnectCommand command. Parameter is the Connector's FrameworkElement.DataContext.

public ICommand DisconnectConnectorCommand { get; set; }  

Property Value

ICommand

DisplayConnectionsOnTop

Gets or sets whether to display connections on top of ItemContainers or not.

public bool DisplayConnectionsOnTop { get; set; }  

Property Value

Boolean

EnableCuttingLinePreview

Gets or sets whether the cutting line should apply the preview style to the interesected elements.

public static bool EnableCuttingLinePreview { get; set; }  

Property Value

Boolean

EnableDraggingContainersOptimizations

Gets or sets if the current position of containers that are being dragged should not be committed until the end of the dragging operation.

public static bool EnableDraggingContainersOptimizations { get; set; }  

Property Value

Boolean

EnableRealtimeSelection

Enables selecting and deselecting items while the NodifyEditor.SelectedArea changes. Disable for maximum performance when hundreds of items are generated.

public bool EnableRealtimeSelection { get; set; }  

Property Value

Boolean

EnableRenderingContainersOptimizations

Gets or sets if NodifyEditors should enable optimizations based on NodifyEditor.OptimizeRenderingMinimumContainers and NodifyEditor.OptimizeRenderingZoomOutPercent.

public static bool EnableRenderingContainersOptimizations { get; set; }  

Property Value

Boolean

EnableSnappingCorrection

Correct ItemContainer's position after moving if starting position is not snapped to grid.

public static bool EnableSnappingCorrection { get; set; }  

Property Value

Boolean

FitToScreenExtentMargin

Gets or sets the margin to add in all directions to the NodifyEditor.ItemsExtent or area parameter when using Nodify.NodifyEditor.FitToScreen(System.Nullable{System.Windows.Rect}).

public static double FitToScreenExtentMargin { get; set; }  

Property Value

Double

GridCellSize

Gets or sets the value of an invisible grid used to adjust locations (snapping) of ItemContainers.

public uint GridCellSize { get; set; }  

Property Value

UInt32

HasContextMenu

Gets a value indicating whether the editor has a context menu.

public bool HasContextMenu { get; set; }  

Property Value

Boolean

HasCustomContextMenu

Gets or sets a value indicating whether the editor uses a custom context menu.

public bool HasCustomContextMenu { get; set; }  

Property Value

Boolean

InputProcessor

protected InputProcessor InputProcessor { get; set; }  

Property Value

InputProcessor

IsBulkUpdatingItems

Tells if the NodifyEditor is doing operations on multiple items at once.

public bool IsBulkUpdatingItems { get; protected set; }  

Property Value

Boolean

IsCutting

Gets a value that indicates whether a cutting operation is in progress.

public bool IsCutting { get; set; }  

Property Value

Boolean

IsDragging

Gets a value that indicates whether a dragging operation is in progress.

public bool IsDragging { get; set; }  

Property Value

Boolean

IsPanning

Gets a value that indicates whether a panning operation is in progress.

public bool IsPanning { get; set; }  

Property Value

Boolean

IsPushingItems

Gets a value that indicates whether a pushing operation is in progress.

public bool IsPushingItems { get; set; }  

Property Value

Boolean

IsSelecting

Gets a value that indicates whether a selection operation is in progress.

public bool IsSelecting { get; set; }  

Property Value

Boolean

ItemsDragCompletedCommand

Invoked when a drag operation is completed for the NodifyEditor.SelectedContainers, or when NodifyEditor.IsPushingItems is set to false.

public ICommand ItemsDragCompletedCommand { get; set; }  

Property Value

ICommand

ItemsDragStartedCommand

Invoked when a drag operation starts for the NodifyEditor.SelectedContainers, or when NodifyEditor.IsPushingItems is set to true.

public ICommand ItemsDragStartedCommand { get; set; }  

Property Value

ICommand

ItemsExtent

The area covered by the ItemContainers.

public Rect ItemsExtent { get; set; }  

Property Value

Rect

ItemsSelectCompletedCommand

Invoked when a selection operation is completed (see Nodify.NodifyEditor.EndSelecting).

public ICommand ItemsSelectCompletedCommand { get; set; }  

Property Value

ICommand

ItemsSelectStartedCommand

Invoked when a selection operation is started (see Nodify.NodifyEditor.BeginSelecting(Nodify.SelectionType)).

public ICommand ItemsSelectStartedCommand { get; set; }  

Property Value

ICommand

MaxViewportZoom

Gets or sets the maximum zoom factor of the viewport

public double MaxViewportZoom { get; set; }  

Property Value

Double

MinViewportZoom

Gets or sets the minimum zoom factor of the viewport

public double MinViewportZoom { get; set; }  

Property Value

Double

MouseActionSuppressionThreshold

Gets or sets the maximum distance, in pixels, that the mouse can move before suppressing certain mouse actions. This is useful for suppressing actions like showing a System.Windows.Controls.ContextMenu if the mouse has moved significantly.

public static double MouseActionSuppressionThreshold { get; set; }  

Property Value

Double

MouseLocation

Gets the current mouse location in graph space coordinates (relative to the NodifyEditor.ItemsHost).

public Point MouseLocation { get; protected set; }  

Property Value

Point

OptimizeRenderingMinimumContainers

Gets or sets the minimum number of ItemContainers needed to trigger optimizations when reaching the NodifyEditor.OptimizeRenderingZoomOutPercent.

public static uint OptimizeRenderingMinimumContainers { get; set; }  

Property Value

UInt32

OptimizeRenderingZoomOutPercent

Gets or sets the minimum zoom out percent needed to start optimizing the rendering for ItemContainers. Value is between 0 and 1.

public static double OptimizeRenderingZoomOutPercent { get; set; }  

Property Value

Double

PendingConnection

Gets of sets the FrameworkElement.DataContext of the PendingConnection.

public object PendingConnection { get; set; }  

Property Value

Object

PendingConnectionTemplate

Gets or sets the DataTemplate to use for the NodifyEditor.PendingConnection.

public DataTemplate PendingConnectionTemplate { get; set; }  

Property Value

DataTemplate

PushedArea

Gets the currently pushed area while NodifyEditor.IsPushingItems is true.

public Rect PushedArea { get; set; }  

Property Value

Rect

PushedAreaOrientation

Gets the orientation of the NodifyEditor.PushedArea.

public Orientation PushedAreaOrientation { get; set; }  

Property Value

Orientation

PushedAreaStyle

Gets or sets the style to use for the pushed area.

public Style PushedAreaStyle { get; set; }  

Property Value

Style

RemoveConnectionCommand

Invoked when the BaseConnection.Disconnect event is raised. Can also be handled at the BaseConnection level using the BaseConnection.DisconnectCommand command. Parameter is the BaseConnection's FrameworkElement.DataContext.

public ICommand RemoveConnectionCommand { get; set; }  

Property Value

ICommand

ScrollIncrement

The number of units the mouse wheel is rotated to scroll one line.

public static double ScrollIncrement { get; set; }  

Property Value

Double

SelectedArea

Gets the currently selected area while NodifyEditor.IsSelecting is true.

public Rect SelectedArea { get; set; }  

Property Value

Rect

SelectedConnection

Gets or sets the selected connection.

public object SelectedConnection { get; set; }  

Property Value

Object

SelectedConnections

Gets or sets the selected connections in the NodifyEditor.

public IList SelectedConnections { get; set; }  

Property Value

IList

SelectedContainersCount

Gets the number of selected containers, without allocating (see NodifyEditor.SelectedContainers).

public int SelectedContainersCount { get; set; }  

Property Value

Int32

SelectedItems

Gets or sets the selected items in the NodifyEditor.

public IList SelectedItems { get; set; }  

Property Value

IList

SelectionRectangleStyle

Gets or sets the style to use for the selection rectangle.

public Style SelectionRectangleStyle { get; set; }  

Property Value

Style

ViewportLocation

Gets or sets the viewport's top-left coordinates in graph space coordinates.

public Point ViewportLocation { get; set; }  

Property Value

Point

ViewportSize

Gets the size of the viewport in graph space (scaled by the NodifyEditor.ViewportZoom).

public Size ViewportSize { get; set; }  

Property Value

Size

ViewportTransform

Gets the transform that is applied to all child controls.

public Transform ViewportTransform { get; set; }  

Property Value

Transform

ViewportZoom

Gets or sets the zoom factor of the viewport.

public double ViewportZoom { get; set; }  

Property Value

Double

Methods

AlignContainers(IEnumerable<ItemContainer>, Alignment, ItemContainer)

Aligns a collection of containers based on the specified alignment.

public void AlignContainers(IEnumerable<ItemContainer> containers, Alignment alignment, ItemContainer relativeTo = null);  

Parameters

containers IEnumerable<ItemContainer>: The collection of item containers to align.

alignment Alignment: The alignment type to apply to the containers.

relativeTo ItemContainer: An optional container to use as a reference for alignment. If null, the alignment is based on the containers themselves.

AlignSelection(Alignment, ItemContainer)

Aligns the selected containers based on the specified alignment.

public void AlignSelection(Alignment alignment, ItemContainer relativeTo = null);  

Parameters

alignment Alignment: The alignment type to apply to the selected containers.

relativeTo ItemContainer: An optional container to use as a reference for alignment. If null, the alignment is based on the containers themselves.

BeginCutting()

Starts the cutting operation at the specified location. Call Nodify.NodifyEditor.EndCutting to complete the operation or Nodify.NodifyEditor.CancelCutting to abort it.

public void BeginCutting();  

BeginCutting(Point)

public void BeginCutting(Point location);  

Parameters

location Point

BeginDragging()

Initiates the dragging operation for the specified ItemContainers. Call Nodify.NodifyEditor.EndDragging to complete the operation or Nodify.NodifyEditor.CancelDragging to abort it.

public void BeginDragging();  

BeginDragging(IEnumerable<ItemContainer>)

public void BeginDragging(IEnumerable<ItemContainer> containers);  

Parameters

containers IEnumerable<ItemContainer>

BeginPanning(Point)

Starts the panning operation from the specified location. Call Nodify.NodifyEditor.EndPanning to end the panning operation.

public void BeginPanning(Point location);  

Parameters

location Point: The initial location where panning starts, in graph space coordinates.

BeginPanning()

Starts the panning operation from the current NodifyEditor.ViewportLocation.

public void BeginPanning();  

BeginPushingItems(Point, Orientation)

Starts the pushing items operation at the specified location with the specified orientation.

public void BeginPushingItems(Point location, Orientation orientation);  

Parameters

location Point: The starting location for pushing items, in graph space coordinates.

orientation Orientation: The orientation of the NodifyEditor.PushedArea.

BeginSelecting(SelectionType)

Initiates a selection operation from the specified location.

public void BeginSelecting(SelectionType type = 0);  

Parameters

type SelectionType: The type of selection to perform. Defaults to SelectionType.Replace.

BeginSelecting(Point, SelectionType)

public void BeginSelecting(Point location, SelectionType type = 0);  

Parameters

location Point

type SelectionType

BringIntoView(Point, Boolean, Action)

Moves the viewport center at the specified location.

public void BringIntoView(Point point, bool animated = true, Action onFinish = null);  

Parameters

point Point: The location in graph space coordinates.

animated Boolean: True to animate the movement.

onFinish Action: The callback invoked when movement is finished.

BringIntoView(Rect)

Moves the viewport center at the center of the specified area.

public void BringIntoView(Rect area);  

Parameters

area Rect: The location in graph space coordinates.

CancelCutting()

Cancels the current cutting operation without applying any changes if NodifyEditor.AllowCuttingCancellation is true. Otherwise, it ends the cutting operation by calling Nodify.NodifyEditor.EndCutting.

public void CancelCutting();  

CancelDragging()

Cancels the ongoing dragging operation, reverting any changes made to the positions of the dragged items if NodifyEditor.AllowDraggingCancellation is true. Otherwise, it ends the dragging operation by calling Nodify.NodifyEditor.EndDragging.

public void CancelDragging();  

CancelPanning()

Cancels the current panning operation and reverts the viewport to its initial location if NodifyEditor.AllowPanningCancellation is true. Otherwise, it ends the panning operation by calling Nodify.NodifyEditor.EndPanning.

public void CancelPanning();  

CancelPushingItems()

Cancels the current pushing operation and reverts the NodifyEditor.PushedArea to its initial state if NodifyEditor.AllowPushItemsCancellation is true. Otherwise, it ends the pushing operation by calling Nodify.NodifyEditor.EndPushingItems.

public void CancelPushingItems();  

CancelSelecting()

Cancels the current selection operation and reverts any changes made during the selection process if NodifyEditor.AllowSelectionCancellation is true. Otherwise, it ends the selection operation by calling Nodify.NodifyEditor.EndSelecting.

public void CancelSelecting();  

EndCutting()

Completes the cutting operation and applies the changes.

public void EndCutting();  

EndDragging()

Completes the dragging operation, finalizing the position of the dragged items. Raises the NodifyEditor.ItemsMoved event.

public void EndDragging();  

EndPanning()

Ends the current panning operation, retaining the current NodifyEditor.ViewportLocation.

public void EndPanning();  

EndPushingItems()

Ends the current pushing operation and finalizes the pushed area state.

public void EndPushingItems();  

EndSelecting()

Completes the selection operation and applies any pending changes.

public void EndSelecting();  

FitToScreen(Rect?)

Scales the viewport to fit the specified area or all the ItemContainers if that's possible.

public void FitToScreen(Rect? area = null);  

Parameters

area Rect?

GetContainerForItemOverride()

protected override DependencyObject GetContainerForItemOverride();  

Returns

DependencyObject

GetLocationInsideEditor(Point, UIElement)

Translates the specified location to graph space coordinates (relative to the NodifyEditor.ItemsHost).

public Point GetLocationInsideEditor(Point location, UIElement relativeTo);  

Parameters

location Point: The location coordinates relative to relativeTo

relativeTo UIElement: The element where the location was calculated from.

Returns

Point: A location inside the graph.

GetLocationInsideEditor(DragEventArgs)

Translates the event location to graph space coordinates (relative to the NodifyEditor.ItemsHost).

public Point GetLocationInsideEditor(DragEventArgs args);  

Parameters

args DragEventArgs: The drag event.

Returns

Point: A location inside the graph

GetLocationInsideEditor(MouseEventArgs)

Translates the event location to graph space coordinates (relative to the NodifyEditor.ItemsHost).

public Point GetLocationInsideEditor(MouseEventArgs args);  

Parameters

args MouseEventArgs: The mouse event.

Returns

Point: A location inside the graph

InvertSelection(Rect, Boolean)

Inverts the ItemContainers selection in the specified area.

public void InvertSelection(Rect area, bool fit = false);  

Parameters

area Rect: The area to look for ItemContainers.

fit Boolean: True to check if the area contains the ItemContainer. False to check if area intersects the ItemContainer.

IsItemItsOwnContainerOverride(Object)

protected override bool IsItemItsOwnContainerOverride(object item);  

Parameters

item Object

Returns

Boolean

LockSelection()

Locks the position of the NodifyEditor.SelectedContainers.

public void LockSelection();  

OnApplyTemplate()

public override void OnApplyTemplate();  

OnKeyDown(KeyEventArgs)

protected override void OnKeyDown(KeyEventArgs e);  

Parameters

e KeyEventArgs

OnKeyUp(KeyEventArgs)

protected override void OnKeyUp(KeyEventArgs e);  

Parameters

e KeyEventArgs

OnLostMouseCapture(MouseEventArgs)

protected override void OnLostMouseCapture(MouseEventArgs e);  

Parameters

e MouseEventArgs

OnMouseDown(MouseButtonEventArgs)

protected override void OnMouseDown(MouseButtonEventArgs e);  

Parameters

e MouseButtonEventArgs

OnMouseMove(MouseEventArgs)

protected override void OnMouseMove(MouseEventArgs e);  

Parameters

e MouseEventArgs

OnMouseUp(MouseButtonEventArgs)

protected override void OnMouseUp(MouseButtonEventArgs e);  

Parameters

e MouseButtonEventArgs

OnMouseWheel(MouseWheelEventArgs)

protected override void OnMouseWheel(MouseWheelEventArgs e);  

Parameters

e MouseWheelEventArgs

OnRemoveConnection(Object)

protected void OnRemoveConnection(object dataContext);  

Parameters

dataContext Object

OnRenderSizeChanged(SizeChangedInfo)

protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo);  

Parameters

sizeInfo SizeChangedInfo

OnSelectionChanged(SelectionChangedEventArgs)

protected override void OnSelectionChanged(SelectionChangedEventArgs e);  

Parameters

e SelectionChangedEventArgs

OnViewportUpdated()

Updates the NodifyEditor.ViewportSize and raises the NodifyEditor.ViewportUpdatedEvent. Called when the UIElement.RenderSize or NodifyEditor.ViewportZoom is changed.

protected void OnViewportUpdated();  

Select(ItemContainer)

Clears the current selection and selects the specified ItemContainer within the same selection transaction.

public void Select(ItemContainer container);  

Parameters

container ItemContainer

SelectAllConnections()

Select all NodifyEditor.Connections.

public void SelectAllConnections();  

SelectArea(Rect, Boolean, Boolean)

Selects the ItemContainers in the specified area.

public void SelectArea(Rect area, bool append = false, bool fit = false);  

Parameters

area Rect: The area to look for ItemContainers.

append Boolean: If true, it will add to the existing selection.

fit Boolean: True to check if the area contains the ItemContainer. False to check if area intersects the ItemContainer.

SnapToGrid(Double)

Snaps the given value down to the nearest multiple of the grid cell size.

public double SnapToGrid(double value);  

Parameters

value Double: The value to be snapped to the grid.

Returns

Double: The largest multiple of the grid cell size less than or equal to the value.

UnlockSelection()

Unlocks the position of the NodifyEditor.SelectedContainers.

public void UnlockSelection();  

UnselectAllConnections()

Unselect all NodifyEditor.Connections.

public void UnselectAllConnections();  

UnselectArea(Rect, Boolean)

Unselect the ItemContainers in the specified area.

public void UnselectArea(Rect area, bool fit = false);  

Parameters

area Rect: The area to look for ItemContainers.

fit Boolean: True to check if the area contains the ItemContainer. False to check if area intersects the ItemContainer.

UpdateCuttingLine(Vector)

Updates the current cutting line position and the style for the intersecting elements if NodifyEditor.EnableCuttingLinePreview is true.

public void UpdateCuttingLine(Vector amount);  

Parameters

amount Vector: The amount to adjust the cutting line's endpoint.

UpdateCuttingLine(Point)

Updates the current cutting line position and the style for the intersecting elements if NodifyEditor.EnableCuttingLinePreview is true.

public void UpdateCuttingLine(Point location);  

Parameters

location Point: The location of the cutting line's endpoint.

UpdateDragging(Vector)

Updates the position of the items being dragged by a specified offset.

public void UpdateDragging(Vector amount);  

Parameters

amount Vector: The vector by which to adjust the position of the dragged items.

UpdatePanning(Vector)

Pans the viewport by the specified amount.

public void UpdatePanning(Vector amount);  

Parameters

amount Vector: The amount to pan the viewport.

UpdatePushedArea(Vector)

Updates the pushed area based on the specified amount taking the NodifyEditor.PushedAreaOrientation into account.

public void UpdatePushedArea(Vector amount);  

Parameters

amount Vector: The amount to adjust the pushed area by.

UpdateSelection(Vector)

Expands or modifies the selection area by the specified amount.

public void UpdateSelection(Vector amount);  

Parameters

amount Vector: Rrepresents the change to apply to the selection area.

UpdateSelection(Point)

Expands or modifies the selection area to the specified location.

public void UpdateSelection(Point location);  

Parameters

location Point: The point, in graph space coordinates, to extend or adjust the selection area to.

ZoomAtPosition(Double, Point)

Zoom at the specified location in graph space coordinates.

public void ZoomAtPosition(double zoom, Point location);  

Parameters

zoom Double: The zoom factor to apply. A value greater than 1 zooms in, while a value between 0 and 1 zooms out.

location Point: The point in graph space coordinates where the zoom should be centered.

ZoomIn()

Zoom in at the viewports center

public void ZoomIn();  

ZoomOut()

Zoom out at the viewports center

public void ZoomOut();  

Events

ItemsMoved

Occurs when items are moved within the editor (see Nodify.NodifyEditor.BeginDragging, Nodify.NodifyEditor.BeginPushingItems(System.Windows.Point,System.Windows.Controls.Orientation)).

public event ItemsMovedEventHandler ItemsMoved;  

Event Type

ItemsMovedEventHandler

ViewportUpdated

Occurs whenever the viewport updates.

public event RoutedEventHandler ViewportUpdated;  

Event Type

RoutedEventHandler

Clone this wiki locally