NodifyEditor
NodifyEditor Class
Section titled “NodifyEditor Class”Namespace: Nodify
Assembly: Nodify
Inheritance: Object → DispatcherObject → DependencyObject → Visual → UIElement → FrameworkElement → Control → ItemsControl → Selector → MultiSelector → NodifyEditor
Implements: IKeyboardNavigationLayer, IKeyboardNavigationLayerGroup, IScrollInfo
References: Alignment, BaseConnection, Connection, ConnectionsMultiSelector, Connector, EditorState.Cutting, CuttingLine, DecoratorContainer, DecoratorsControl, EditorCommands, EditorGestures, GroupingNode, IKeyboardFocusTarget<ItemContainer>, InputProcessor, ItemContainer, ItemsMovedEventArgs, ItemsMovedEventHandler, EditorState.KeyboardNavigation, KeyboardNavigationLayerId, 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, IKeyboardNavigationLayer, IKeyboardNavigationLayerGroup, IScrollInfo
Constructors
Section titled “Constructors”NodifyEditor()
Section titled “NodifyEditor()”Initializes a new instance of the NodifyEditor class.
public NodifyEditor();
Fields
Section titled “Fields”CuttingConnectionTypes
Section titled “CuttingConnectionTypes”The list of supported connection types for cutting. Type must be derived from FrameworkElement.
public static HashSet<Type> CuttingConnectionTypes;
Field Value
CuttingLineEndPropertyKey
Section titled “CuttingLineEndPropertyKey”protected static DependencyPropertyKey CuttingLineEndPropertyKey;
Field Value
CuttingLineStartPropertyKey
Section titled “CuttingLineStartPropertyKey”protected static DependencyPropertyKey CuttingLineStartPropertyKey;
Field Value
ElementConnectionsHost
Section titled “ElementConnectionsHost”protected const string ElementConnectionsHost = "PART_ConnectionsHost";
Field Value
ElementItemsHost
Section titled “ElementItemsHost”protected const string ElementItemsHost = "PART_ItemsHost";
Field Value
IsCuttingPropertyKey
Section titled “IsCuttingPropertyKey”protected static DependencyPropertyKey IsCuttingPropertyKey;
Field Value
IsDraggingPropertyKey
Section titled “IsDraggingPropertyKey”protected static DependencyPropertyKey IsDraggingPropertyKey;
Field Value
IsPanningPropertyKey
Section titled “IsPanningPropertyKey”protected static DependencyPropertyKey IsPanningPropertyKey;
Field Value
IsPushingItemsPropertyKey
Section titled “IsPushingItemsPropertyKey”protected static DependencyPropertyKey IsPushingItemsPropertyKey;
Field Value
IsSelectingPropertyKey
Section titled “IsSelectingPropertyKey”protected static DependencyPropertyKey IsSelectingPropertyKey;
Field Value
PushedAreaOrientationPropertyKey
Section titled “PushedAreaOrientationPropertyKey”protected static DependencyPropertyKey PushedAreaOrientationPropertyKey;
Field Value
PushedAreaPropertyKey
Section titled “PushedAreaPropertyKey”protected static DependencyPropertyKey PushedAreaPropertyKey;
Field Value
ScaleTransform
Section titled “ScaleTransform”Gets the transform used to zoom on the viewport.
protected readonly ScaleTransform ScaleTransform;
Field Value
SelectedAreaPropertyKey
Section titled “SelectedAreaPropertyKey”protected static DependencyPropertyKey SelectedAreaPropertyKey;
Field Value
TranslateTransform
Section titled “TranslateTransform”Gets the transform used to offset the viewport.
protected readonly TranslateTransform TranslateTransform;
Field Value
ViewportTransformPropertyKey
Section titled “ViewportTransformPropertyKey”protected static DependencyPropertyKey ViewportTransformPropertyKey;
Field Value
Properties
Section titled “Properties”ActiveNavigationLayer
Section titled “ActiveNavigationLayer”public virtual IKeyboardNavigationLayer ActiveNavigationLayer { get; set; }
Property Value
AllowCuttingCancellation
Section titled “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
AllowDraggingCancellation
Section titled “AllowDraggingCancellation”Gets or sets whether cancelling a dragging operation is allowed.
public static bool AllowDraggingCancellation { get; set; }
Property Value
AllowPanningCancellation
Section titled “AllowPanningCancellation”Gets or sets whether panning cancellation is allowed (see Nodify.Interactivity.EditorGestures.NodifyEditorGestures.CancelAction).
public static bool AllowPanningCancellation { get; set; }
Property Value
AllowPushItemsCancellation
Section titled “AllowPushItemsCancellation”Gets or sets whether push items cancellation is allowed (see Nodify.Interactivity.EditorGestures.NodifyEditorGestures.CancelAction).
public static bool AllowPushItemsCancellation { get; set; }
Property Value
AllowSelectionCancellation
Section titled “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
AutoFocusFirstElement
Section titled “AutoFocusFirstElement”Automatically focus the first container when the navigation layer changes or the editor gets focused.
public static bool AutoFocusFirstElement { get; set; }
Property Value
AutoPanEdgeDistance
Section titled “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
AutoPanningTickRate
Section titled “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
AutoPanOnNodeFocus
Section titled “AutoPanOnNodeFocus”Automatically pan the viewport when a node is focused via keyboard navigation.
public static bool AutoPanOnNodeFocus { get; set; }
Property Value
AutoPanSpeed
Section titled “AutoPanSpeed”Gets or sets the speed used when auto-panning scaled by NodifyEditor.AutoPanningTickRate
public double AutoPanSpeed { get; set; }
Property Value
AutoRegisterConnectionsLayer
Section titled “AutoRegisterConnectionsLayer”Automatically registers the connectors layer for keyboard navigation.
public static bool AutoRegisterConnectionsLayer { get; set; }
Property Value
AutoRegisterDecoratorsLayer
Section titled “AutoRegisterDecoratorsLayer”Automatically registers the decorators layer for keyboard navigation.
public static bool AutoRegisterDecoratorsLayer { get; set; }
Property Value
BringIntoViewEdgeOffset
Section titled “BringIntoViewEdgeOffset”Gets or sets the default viewport edge offset applied when bringing an item into view as a result of keyboard focus.
public static double BringIntoViewEdgeOffset { get; set; }
Property Value
BringIntoViewMaxDuration
Section titled “BringIntoViewMaxDuration”Gets or sets the maximum animation duration in seconds for bringing a location into view.
public double BringIntoViewMaxDuration { get; set; }
Property Value
BringIntoViewSpeed
Section titled “BringIntoViewSpeed”Gets or sets the animation speed in pixels per second for bringing a location into view.
public double BringIntoViewSpeed { get; set; }
Property Value
CanSelectMultipleConnections
Section titled “CanSelectMultipleConnections”Gets or sets whether multiple connections can be selected.
public bool CanSelectMultipleConnections { get; set; }
Property Value
CanSelectMultipleItems
Section titled “CanSelectMultipleItems”Gets or sets whether multiple ItemContainers can be selected.
public bool CanSelectMultipleItems { get; set; }
Property Value
ConnectionCompletedCommand
Section titled “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.Tuple
2.Item1 is the PendingConnection.Source and System.Tuple`2.Item2 is PendingConnection.Target.
public ICommand ConnectionCompletedCommand { get; set; }
Property Value
Connections
Section titled “Connections”Gets or sets the data source that BaseConnections will be generated for.
public IEnumerable Connections { get; set; }
Property Value
ConnectionStartedCommand
Section titled “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
ConnectionTemplate
Section titled “ConnectionTemplate”Gets or sets the DataTemplate to use when generating a new BaseConnection.
public DataTemplate ConnectionTemplate { get; set; }
Property Value
CuttingCompletedCommand
Section titled “CuttingCompletedCommand”Invoked when a cutting operation is completed.
public ICommand CuttingCompletedCommand { get; set; }
Property Value
CuttingLineEnd
Section titled “CuttingLineEnd”Gets the end point of the CuttingLine while NodifyEditor.IsCutting is true.
public Point CuttingLineEnd { get; set; }
Property Value
CuttingLineStart
Section titled “CuttingLineStart”Gets the start point of the CuttingLine while NodifyEditor.IsCutting is true.
public Point CuttingLineStart { get; set; }
Property Value
CuttingLineStyle
Section titled “CuttingLineStyle”Gets or sets the style to use for the cutting line.
public Style CuttingLineStyle { get; set; }
Property Value
CuttingStartedCommand
Section titled “CuttingStartedCommand”Invoked when a cutting operation is started.
public ICommand CuttingStartedCommand { get; set; }
Property Value
DecoratorContainerStyle
Section titled “DecoratorContainerStyle”Gets or sets the style to use for the DecoratorContainer.
public Style DecoratorContainerStyle { get; set; }
Property Value
Decorators
Section titled “Decorators”Gets or sets the items that will be rendered in the decorators layer via DecoratorContainers.
public IEnumerable Decorators { get; set; }
Property Value
DecoratorsExtent
Section titled “DecoratorsExtent”The area covered by the DecoratorContainers.
public Rect DecoratorsExtent { get; set; }
Property Value
DecoratorTemplate
Section titled “DecoratorTemplate”Gets or sets the DataTemplate to use when generating a new DecoratorContainer.
public DataTemplate DecoratorTemplate { get; set; }
Property Value
DisableAutoPanning
Section titled “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
DisablePanning
Section titled “DisablePanning”Gets or sets whether panning should be disabled.
public bool DisablePanning { get; set; }
Property Value
DisableZooming
Section titled “DisableZooming”Gets or sets whether zooming should be disabled.
public bool DisableZooming { get; set; }
Property Value
DisconnectConnectorCommand
Section titled “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
DisplayConnectionsOnTop
Section titled “DisplayConnectionsOnTop”Gets or sets whether to display connections on top of ItemContainers or not.
public bool DisplayConnectionsOnTop { get; set; }
Property Value
EnableCuttingLinePreview
Section titled “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
EnableDraggingContainersOptimizations
Section titled “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
EnableRealtimeSelection
Section titled “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
EnableRenderingContainersOptimizations
Section titled “EnableRenderingContainersOptimizations”Gets or sets if NodifyEditors should enable optimizations based on NodifyEditor.OptimizeRenderingMinimumContainers and NodifyEditor.OptimizeRenderingZoomOutPercent.
public static bool EnableRenderingContainersOptimizations { get; set; }
Property Value
EnableSnappingCorrection
Section titled “EnableSnappingCorrection”Correct ItemContainer’s position after moving if starting position is not snapped to grid.
public static bool EnableSnappingCorrection { get; set; }
Property Value
FitToScreenExtentMargin
Section titled “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
GridCellSize
Section titled “GridCellSize”Gets or sets the value of an invisible grid used to adjust locations (snapping) of ItemContainers.
public uint GridCellSize { get; set; }
Property Value
HasContextMenu
Section titled “HasContextMenu”Gets a value indicating whether the editor has a context menu.
public bool HasContextMenu { get; set; }
Property Value
HasCustomContextMenu
Section titled “HasCustomContextMenu”Gets or sets a value indicating whether the editor uses a custom context menu.
public bool HasCustomContextMenu { get; set; }
Property Value
InputProcessor
Section titled “InputProcessor”protected InputProcessor InputProcessor { get; set; }
Property Value
IsBulkUpdatingItems
Section titled “IsBulkUpdatingItems”Tells if the NodifyEditor is doing operations on multiple items at once.
public bool IsBulkUpdatingItems { get; protected set; }
Property Value
IsCutting
Section titled “IsCutting”Gets a value that indicates whether a cutting operation is in progress.
public bool IsCutting { get; set; }
Property Value
IsDragging
Section titled “IsDragging”Gets a value that indicates whether a dragging operation is in progress.
public bool IsDragging { get; set; }
Property Value
IsPanning
Section titled “IsPanning”Gets a value that indicates whether a panning operation is in progress.
public bool IsPanning { get; set; }
Property Value
IsPushingItems
Section titled “IsPushingItems”Gets a value that indicates whether a pushing operation is in progress.
public bool IsPushingItems { get; set; }
Property Value
IsSelecting
Section titled “IsSelecting”Gets a value that indicates whether a selection operation is in progress.
public bool IsSelecting { get; set; }
Property Value
ItemsDragCompletedCommand
Section titled “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
ItemsDragStartedCommand
Section titled “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
ItemsExtent
Section titled “ItemsExtent”The area covered by the ItemContainers.
public Rect ItemsExtent { get; set; }
Property Value
ItemsSelectCompletedCommand
Section titled “ItemsSelectCompletedCommand”Invoked when a selection operation is completed (see Nodify.NodifyEditor.EndSelecting).
public ICommand ItemsSelectCompletedCommand { get; set; }
Property Value
ItemsSelectStartedCommand
Section titled “ItemsSelectStartedCommand”Invoked when a selection operation is started (see Nodify.NodifyEditor.BeginSelecting(Nodify.SelectionType)).
public ICommand ItemsSelectStartedCommand { get; set; }
Property Value
KeyboardNavigationLayer
Section titled “KeyboardNavigationLayer”public IKeyboardNavigationLayer KeyboardNavigationLayer { get; set; }
Property Value
MaxViewportZoom
Section titled “MaxViewportZoom”Gets or sets the maximum zoom factor of the viewport
public double MaxViewportZoom { get; set; }
Property Value
MinimumNavigationStepSize
Section titled “MinimumNavigationStepSize”Defines the minimum distance to move or navigate when using directional input (such as arrow keys), scaled by the NodifyEditor.ViewportZoom. If the NodifyEditor.GridCellSize is smaller than this value, the movement step is increased to the nearest greater multiple of the NodifyEditor.GridCellSize.
public static double MinimumNavigationStepSize { get; set; }
Property Value
MinViewportZoom
Section titled “MinViewportZoom”Gets or sets the minimum zoom factor of the viewport
public double MinViewportZoom { get; set; }
Property Value
MouseActionSuppressionThreshold
Section titled “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
MouseLocation
Section titled “MouseLocation”Gets the current mouse location in graph space coordinates (relative to the NodifyEditor.ItemsHost).
public Point MouseLocation { get; protected set; }
Property Value
OptimizeRenderingMinimumContainers
Section titled “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
OptimizeRenderingZoomOutPercent
Section titled “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
PanViewportOnKeyboardDrag
Section titled “PanViewportOnKeyboardDrag”Indicates whether the viewport should automatically pan to follow elements moved via keyboard dragging.
public static bool PanViewportOnKeyboardDrag { get; set; }
Property Value
PendingConnection
Section titled “PendingConnection”Gets of sets the FrameworkElement.DataContext of the PendingConnection.
public object PendingConnection { get; set; }
Property Value
PendingConnectionTemplate
Section titled “PendingConnectionTemplate”Gets or sets the DataTemplate to use for the NodifyEditor.PendingConnection.
public DataTemplate PendingConnectionTemplate { get; set; }
Property Value
PushedArea
Section titled “PushedArea”Gets the currently pushed area while NodifyEditor.IsPushingItems is true.
public Rect PushedArea { get; set; }
Property Value
PushedAreaOrientation
Section titled “PushedAreaOrientation”Gets the orientation of the NodifyEditor.PushedArea.
public Orientation PushedAreaOrientation { get; set; }
Property Value
PushedAreaStyle
Section titled “PushedAreaStyle”Gets or sets the style to use for the pushed area.
public Style PushedAreaStyle { get; set; }
Property Value
RemoveConnectionCommand
Section titled “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
ScrollIncrement
Section titled “ScrollIncrement”The number of units the mouse wheel is rotated to scroll one line.
public static double ScrollIncrement { get; set; }
Property Value
SelectedArea
Section titled “SelectedArea”Gets the currently selected area while NodifyEditor.IsSelecting is true.
public Rect SelectedArea { get; set; }
Property Value
SelectedConnection
Section titled “SelectedConnection”Gets or sets the selected connection.
public object SelectedConnection { get; set; }
Property Value
SelectedConnections
Section titled “SelectedConnections”Gets or sets the selected connections in the NodifyEditor.
public IList SelectedConnections { get; set; }
Property Value
SelectedContainersCount
Section titled “SelectedContainersCount”Gets the number of selected containers, without allocating (see NodifyEditor.SelectedContainers).
public int SelectedContainersCount { get; set; }
Property Value
SelectedItems
Section titled “SelectedItems”Gets or sets the selected items in the NodifyEditor.
public IList SelectedItems { get; set; }
Property Value
SelectionRectangleStyle
Section titled “SelectionRectangleStyle”Gets or sets the style to use for the selection rectangle.
public Style SelectionRectangleStyle { get; set; }
Property Value
ViewportLocation
Section titled “ViewportLocation”Gets or sets the viewport’s top-left coordinates in graph space coordinates.
public Point ViewportLocation { get; set; }
Property Value
ViewportSize
Section titled “ViewportSize”Gets the size of the viewport in graph space (scaled by the NodifyEditor.ViewportZoom).
public Size ViewportSize { get; set; }
Property Value
ViewportTransform
Section titled “ViewportTransform”Gets the transform that is applied to all child controls.
public Transform ViewportTransform { get; set; }
Property Value
ViewportZoom
Section titled “ViewportZoom”Gets or sets the zoom factor of the viewport.
public double ViewportZoom { get; set; }
Property Value
Methods
Section titled “Methods”ActivateNavigationLayer(KeyboardNavigationLayerId)
Section titled “ActivateNavigationLayer(KeyboardNavigationLayerId)”public virtual bool ActivateNavigationLayer(KeyboardNavigationLayerId layerId);
Parameters
layerId
KeyboardNavigationLayerId
Returns
ActivateNextNavigationLayer()
Section titled “ActivateNextNavigationLayer()”public virtual bool ActivateNextNavigationLayer();
Returns
ActivatePreviousNavigationLayer()
Section titled “ActivatePreviousNavigationLayer()”public virtual bool ActivatePreviousNavigationLayer();
Returns
AlignContainers(IEnumerable<ItemContainer>, Alignment, ItemContainer)
Section titled “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)
Section titled “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()
Section titled “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)
Section titled “BeginCutting(Point)”public void BeginCutting(Point location);
Parameters
location
Point
BeginDragging()
Section titled “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>)
Section titled “BeginDragging(IEnumerable<ItemContainer>)”public void BeginDragging(IEnumerable<ItemContainer> containers);
Parameters
containers
IEnumerable<ItemContainer>
BeginPanning(Point)
Section titled “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()
Section titled “BeginPanning()”Starts the panning operation from the current NodifyEditor.ViewportLocation.
public void BeginPanning();
BeginPushingItems(Point, Orientation)
Section titled “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)
Section titled “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)
Section titled “BeginSelecting(Point, SelectionType)”public void BeginSelecting(Point location, SelectionType type = 0);
Parameters
location
Point
type
SelectionType
BringIntoView(Point, Boolean, Action)
Section titled “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)
Section titled “BringIntoView(Rect)”Ensures the specified item container is fully visible within the viewport, optionally with padding around the edges.
public void BringIntoView(Rect area);
Parameters
area
Rect: The location in graph space coordinates.
BringIntoView(Rect, Double)
Section titled “BringIntoView(Rect, Double)”public void BringIntoView(Rect area, double offsetFromEdge = 32d);
Parameters
area
Rect
offsetFromEdge
Double
CancelCutting()
Section titled “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()
Section titled “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()
Section titled “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()
Section titled “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()
Section titled “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()
Section titled “EndCutting()”Completes the cutting operation and applies the changes.
public void EndCutting();
EndDragging()
Section titled “EndDragging()”Completes the dragging operation, finalizing the position of the dragged items. Raises the NodifyEditor.ItemsMoved event.
public void EndDragging();
EndPanning()
Section titled “EndPanning()”Ends the current panning operation, retaining the current NodifyEditor.ViewportLocation.
public void EndPanning();
EndPushingItems()
Section titled “EndPushingItems()”Ends the current pushing operation and finalizes the pushed area state.
public void EndPushingItems();
EndSelecting()
Section titled “EndSelecting()”Completes the selection operation and applies any pending changes.
public void EndSelecting();
FindNextFocusTarget(ItemContainer, TraversalRequest)
Section titled “FindNextFocusTarget(ItemContainer, TraversalRequest)”protected virtual ItemContainer FindNextFocusTarget(ItemContainer currentContainer, TraversalRequest request);
Parameters
currentContainer
ItemContainer
request
TraversalRequest
Returns
FitToScreen(Rect?)
Section titled “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()
Section titled “GetContainerForItemOverride()”protected override DependencyObject GetContainerForItemOverride();
Returns
GetEnumerator()
Section titled “GetEnumerator()”public virtual IEnumerator<IKeyboardNavigationLayer> GetEnumerator();
Returns
IEnumerator<IKeyboardNavigationLayer>
GetLocationInsideEditor(Point, UIElement)
Section titled “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)
Section titled “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)
Section titled “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)
Section titled “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)
Section titled “IsItemItsOwnContainerOverride(Object)”protected override bool IsItemItsOwnContainerOverride(object item);
Parameters
item
Object
Returns
LockSelection()
Section titled “LockSelection()”Locks the position of the NodifyEditor.SelectedContainers.
public void LockSelection();
MoveFocus(FocusNavigationDirection)
Section titled “MoveFocus(FocusNavigationDirection)”public bool MoveFocus(FocusNavigationDirection direction);
Parameters
direction
FocusNavigationDirection
Returns
MoveFocus(TraversalRequest)
Section titled “MoveFocus(TraversalRequest)”public bool MoveFocus(TraversalRequest request);
Parameters
request
TraversalRequest
Returns
OnApplyTemplate()
Section titled “OnApplyTemplate()”public override void OnApplyTemplate();
OnElementFocused(IKeyboardFocusTarget<ItemContainer>)
Section titled “OnElementFocused(IKeyboardFocusTarget<ItemContainer>)”protected virtual void OnElementFocused(IKeyboardFocusTarget<ItemContainer> target);
Parameters
target
IKeyboardFocusTarget<ItemContainer>
OnGotKeyboardFocus(KeyboardFocusChangedEventArgs)
Section titled “OnGotKeyboardFocus(KeyboardFocusChangedEventArgs)”protected override void OnGotKeyboardFocus(KeyboardFocusChangedEventArgs e);
Parameters
e
KeyboardFocusChangedEventArgs
OnKeyboardNavigationLayerActivated(IKeyboardNavigationLayer)
Section titled “OnKeyboardNavigationLayerActivated(IKeyboardNavigationLayer)”protected virtual void OnKeyboardNavigationLayerActivated(IKeyboardNavigationLayer activeLayer);
Parameters
activeLayer
IKeyboardNavigationLayer
OnKeyDown(KeyEventArgs)
Section titled “OnKeyDown(KeyEventArgs)”protected override void OnKeyDown(KeyEventArgs e);
Parameters
OnKeyUp(KeyEventArgs)
Section titled “OnKeyUp(KeyEventArgs)”protected override void OnKeyUp(KeyEventArgs e);
Parameters
OnLostKeyboardFocus(KeyboardFocusChangedEventArgs)
Section titled “OnLostKeyboardFocus(KeyboardFocusChangedEventArgs)”protected override void OnLostKeyboardFocus(KeyboardFocusChangedEventArgs e);
Parameters
e
KeyboardFocusChangedEventArgs
OnLostMouseCapture(MouseEventArgs)
Section titled “OnLostMouseCapture(MouseEventArgs)”protected override void OnLostMouseCapture(MouseEventArgs e);
Parameters
OnMouseDown(MouseButtonEventArgs)
Section titled “OnMouseDown(MouseButtonEventArgs)”protected override void OnMouseDown(MouseButtonEventArgs e);
Parameters
OnMouseMove(MouseEventArgs)
Section titled “OnMouseMove(MouseEventArgs)”protected override void OnMouseMove(MouseEventArgs e);
Parameters
OnMouseUp(MouseButtonEventArgs)
Section titled “OnMouseUp(MouseButtonEventArgs)”protected override void OnMouseUp(MouseButtonEventArgs e);
Parameters
OnMouseWheel(MouseWheelEventArgs)
Section titled “OnMouseWheel(MouseWheelEventArgs)”protected override void OnMouseWheel(MouseWheelEventArgs e);
Parameters
OnRemoveConnection(Object)
Section titled “OnRemoveConnection(Object)”protected void OnRemoveConnection(object dataContext);
Parameters
dataContext
Object
OnRenderSizeChanged(SizeChangedInfo)
Section titled “OnRenderSizeChanged(SizeChangedInfo)”protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo);
Parameters
sizeInfo
SizeChangedInfo
OnSelectionChanged(SelectionChangedEventArgs)
Section titled “OnSelectionChanged(SelectionChangedEventArgs)”protected override void OnSelectionChanged(SelectionChangedEventArgs e);
Parameters
OnViewportUpdated()
Section titled “OnViewportUpdated()”Updates the NodifyEditor.ViewportSize and raises the NodifyEditor.ViewportUpdatedEvent. Called when the UIElement.RenderSize or NodifyEditor.ViewportZoom is changed.
protected void OnViewportUpdated();
RegisterNavigationLayer(IKeyboardNavigationLayer)
Section titled “RegisterNavigationLayer(IKeyboardNavigationLayer)”public virtual bool RegisterNavigationLayer(IKeyboardNavigationLayer layer);
Parameters
layer
IKeyboardNavigationLayer
Returns
RemoveNavigationLayer(KeyboardNavigationLayerId)
Section titled “RemoveNavigationLayer(KeyboardNavigationLayerId)”public virtual bool RemoveNavigationLayer(KeyboardNavigationLayerId layerId);
Parameters
layerId
KeyboardNavigationLayerId
Returns
ResetViewport(Boolean, Action)
Section titled “ResetViewport(Boolean, Action)”Reset the viewport location to (0, 0) and the viewport zoom to 1.
public void ResetViewport(bool animated = true, Action onFinish = null);
Parameters
animated
Boolean: Whether the viewport transition is animated.
onFinish
Action: The callback invoked when the viewport transition is finished.
Select(ItemContainer)
Section titled “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()
Section titled “SelectAllConnections()”Select all NodifyEditor.Connections.
public void SelectAllConnections();
SelectArea(Rect, Boolean, Boolean)
Section titled “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)
Section titled “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()
Section titled “UnlockSelection()”Unlocks the position of the NodifyEditor.SelectedContainers.
public void UnlockSelection();
UnselectAllConnections()
Section titled “UnselectAllConnections()”Unselect all NodifyEditor.Connections.
public void UnselectAllConnections();
UnselectArea(Rect, Boolean)
Section titled “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)
Section titled “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)
Section titled “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)
Section titled “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)
Section titled “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)
Section titled “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)
Section titled “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)
Section titled “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)
Section titled “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()
Section titled “ZoomIn()”Zoom in at the viewport’s center.
public void ZoomIn();
ZoomOut()
Section titled “ZoomOut()”Zoom out at the viewport’s center.
public void ZoomOut();
Events
Section titled “Events”ActiveNavigationLayerChanged
Section titled “ActiveNavigationLayerChanged”public virtual event Action<KeyboardNavigationLayerId> ActiveNavigationLayerChanged;
Event Type
Action<KeyboardNavigationLayerId>
ItemsMoved
Section titled “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
ViewportUpdated
Section titled “ViewportUpdated”Occurs whenever the viewport updates.
public event RoutedEventHandler ViewportUpdated;
Event Type