61 KiB
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
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
CuttingLineEndPropertyKey
protected static DependencyPropertyKey CuttingLineEndPropertyKey;
Field Value
CuttingLineStartPropertyKey
protected static DependencyPropertyKey CuttingLineStartPropertyKey;
Field Value
ElementConnectionsHost
protected const string ElementConnectionsHost = "PART_ConnectionsHost";
Field Value
ElementItemsHost
protected const string ElementItemsHost = "PART_ItemsHost";
Field Value
IsCuttingPropertyKey
protected static DependencyPropertyKey IsCuttingPropertyKey;
Field Value
IsDraggingPropertyKey
protected static DependencyPropertyKey IsDraggingPropertyKey;
Field Value
IsPanningPropertyKey
protected static DependencyPropertyKey IsPanningPropertyKey;
Field Value
IsPushingItemsPropertyKey
protected static DependencyPropertyKey IsPushingItemsPropertyKey;
Field Value
IsSelectingPropertyKey
protected static DependencyPropertyKey IsSelectingPropertyKey;
Field Value
PushedAreaOrientationPropertyKey
protected static DependencyPropertyKey PushedAreaOrientationPropertyKey;
Field Value
PushedAreaPropertyKey
protected static DependencyPropertyKey PushedAreaPropertyKey;
Field Value
ScaleTransform
Gets the transform used to zoom on the viewport.
protected readonly ScaleTransform ScaleTransform;
Field Value
SelectedAreaPropertyKey
protected static DependencyPropertyKey SelectedAreaPropertyKey;
Field Value
TranslateTransform
Gets the transform used to offset the viewport.
protected readonly TranslateTransform TranslateTransform;
Field Value
ViewportTransformPropertyKey
protected static DependencyPropertyKey ViewportTransformPropertyKey;
Field Value
Properties
ActiveNavigationLayer
public virtual IKeyboardNavigationLayer ActiveNavigationLayer { get; set; }
Property Value
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
Gets or sets whether cancelling a dragging operation is allowed.
public static bool AllowDraggingCancellation { get; set; }
Property Value
AllowPanningCancellation
Gets or sets whether panning cancellation is allowed (see Nodify.Interactivity.EditorGestures.NodifyEditorGestures.CancelAction).
public static bool AllowPanningCancellation { get; set; }
Property Value
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
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
Automatically focus the first container when the navigation layer changes or the editor gets focused.
public static bool AutoFocusFirstElement { get; set; }
Property Value
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
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
Automatically pan the viewport when a node is focused via keyboard navigation.
public static bool AutoPanOnNodeFocus { get; set; }
Property Value
AutoPanSpeed
Gets or sets the speed used when auto-panning scaled by NodifyEditor.AutoPanningTickRate
public double AutoPanSpeed { get; set; }
Property Value
AutoRegisterConnectionsLayer
Automatically registers the connectors layer for keyboard navigation.
public static bool AutoRegisterConnectionsLayer { get; set; }
Property Value
AutoRegisterDecoratorsLayer
Automatically registers the decorators layer for keyboard navigation.
public static bool AutoRegisterDecoratorsLayer { get; set; }
Property Value
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
Gets or sets the maximum animation duration in seconds for bringing a location into view.
public double BringIntoViewMaxDuration { get; set; }
Property Value
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
Gets or sets whether multiple connections can be selected.
public bool CanSelectMultipleConnections { get; set; }
Property Value
CanSelectMultipleItems
Gets or sets whether multiple ItemContainers can be selected.
public bool CanSelectMultipleItems { get; set; }
Property Value
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
Connections
Gets or sets the data source that BaseConnections will be generated for.
public IEnumerable Connections { get; set; }
Property Value
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
Gets or sets the DataTemplate to use when generating a new BaseConnection.
public DataTemplate ConnectionTemplate { get; set; }
Property Value
CuttingCompletedCommand
Invoked when a cutting operation is completed.
public ICommand CuttingCompletedCommand { get; set; }
Property Value
CuttingLineEnd
Gets the end point of the CuttingLine while NodifyEditor.IsCutting is true.
public Point CuttingLineEnd { get; set; }
Property Value
CuttingLineStart
Gets the start point of the CuttingLine while NodifyEditor.IsCutting is true.
public Point CuttingLineStart { get; set; }
Property Value
CuttingLineStyle
Gets or sets the style to use for the cutting line.
public Style CuttingLineStyle { get; set; }
Property Value
CuttingStartedCommand
Invoked when a cutting operation is started.
public ICommand CuttingStartedCommand { get; set; }
Property Value
DecoratorContainerStyle
Gets or sets the style to use for the DecoratorContainer.
public Style DecoratorContainerStyle { get; set; }
Property Value
Decorators
Gets or sets the items that will be rendered in the decorators layer via DecoratorContainers.
public IEnumerable Decorators { get; set; }
Property Value
DecoratorsExtent
The area covered by the DecoratorContainers.
public Rect DecoratorsExtent { get; set; }
Property Value
DecoratorTemplate
Gets or sets the DataTemplate to use when generating a new DecoratorContainer.
public DataTemplate DecoratorTemplate { get; set; }
Property Value
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
Gets or sets whether panning should be disabled.
public bool DisablePanning { get; set; }
Property Value
DisableZooming
Gets or sets whether zooming should be disabled.
public bool DisableZooming { get; set; }
Property Value
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
Gets or sets whether to display connections on top of ItemContainers or not.
public bool DisplayConnectionsOnTop { get; set; }
Property Value
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
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
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
Gets or sets if NodifyEditors should enable optimizations based on NodifyEditor.OptimizeRenderingMinimumContainers and NodifyEditor.OptimizeRenderingZoomOutPercent.
public static bool EnableRenderingContainersOptimizations { get; set; }
Property Value
EnableSnappingCorrection
Correct ItemContainer's position after moving if starting position is not snapped to grid.
public static bool EnableSnappingCorrection { get; set; }
Property Value
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
Gets or sets the value of an invisible grid used to adjust locations (snapping) of ItemContainers.
public uint GridCellSize { get; set; }
Property Value
HasContextMenu
Gets a value indicating whether the editor has a context menu.
public bool HasContextMenu { get; set; }
Property Value
HasCustomContextMenu
Gets or sets a value indicating whether the editor uses a custom context menu.
public bool HasCustomContextMenu { get; set; }
Property Value
InputProcessor
protected InputProcessor InputProcessor { get; set; }
Property Value
IsBulkUpdatingItems
Tells if the NodifyEditor is doing operations on multiple items at once.
public bool IsBulkUpdatingItems { get; protected set; }
Property Value
IsCutting
Gets a value that indicates whether a cutting operation is in progress.
public bool IsCutting { get; set; }
Property Value
IsDragging
Gets a value that indicates whether a dragging operation is in progress.
public bool IsDragging { get; set; }
Property Value
IsPanning
Gets a value that indicates whether a panning operation is in progress.
public bool IsPanning { get; set; }
Property Value
IsPushingItems
Gets a value that indicates whether a pushing operation is in progress.
public bool IsPushingItems { get; set; }
Property Value
IsSelecting
Gets a value that indicates whether a selection operation is in progress.
public bool IsSelecting { get; set; }
Property Value
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
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
The area covered by the ItemContainers.
public Rect ItemsExtent { get; set; }
Property Value
ItemsSelectCompletedCommand
Invoked when a selection operation is completed (see Nodify.NodifyEditor.EndSelecting).
public ICommand ItemsSelectCompletedCommand { get; set; }
Property Value
ItemsSelectStartedCommand
Invoked when a selection operation is started (see Nodify.NodifyEditor.BeginSelecting(Nodify.SelectionType)).
public ICommand ItemsSelectStartedCommand { get; set; }
Property Value
KeyboardNavigationLayer
public IKeyboardNavigationLayer KeyboardNavigationLayer { get; set; }
Property Value
MaxViewportZoom
Gets or sets the maximum zoom factor of the viewport
public double MaxViewportZoom { get; set; }
Property Value
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
Gets or sets the minimum zoom factor of the viewport
public double MinViewportZoom { get; set; }
Property Value
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
Gets the current mouse location in graph space coordinates (relative to the NodifyEditor.ItemsHost).
public Point MouseLocation { get; protected set; }
Property Value
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
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
Indicates whether the viewport should automatically pan to follow elements moved via keyboard dragging.
public static bool PanViewportOnKeyboardDrag { get; set; }
Property Value
PendingConnection
Gets of sets the FrameworkElement.DataContext of the PendingConnection.
public object PendingConnection { get; set; }
Property Value
PendingConnectionTemplate
Gets or sets the DataTemplate to use for the NodifyEditor.PendingConnection.
public DataTemplate PendingConnectionTemplate { get; set; }
Property Value
PushedArea
Gets the currently pushed area while NodifyEditor.IsPushingItems is true.
public Rect PushedArea { get; set; }
Property Value
PushedAreaOrientation
Gets the orientation of the NodifyEditor.PushedArea.
public Orientation PushedAreaOrientation { get; set; }
Property Value
PushedAreaStyle
Gets or sets the style to use for the pushed area.
public Style PushedAreaStyle { get; set; }
Property Value
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
The number of units the mouse wheel is rotated to scroll one line.
public static double ScrollIncrement { get; set; }
Property Value
SelectedArea
Gets the currently selected area while NodifyEditor.IsSelecting is true.
public Rect SelectedArea { get; set; }
Property Value
SelectedConnection
Gets or sets the selected connection.
public object SelectedConnection { get; set; }
Property Value
SelectedConnections
Gets or sets the selected connections in the NodifyEditor.
public IList SelectedConnections { get; set; }
Property Value
SelectedContainersCount
Gets the number of selected containers, without allocating (see NodifyEditor.SelectedContainers).
public int SelectedContainersCount { get; set; }
Property Value
SelectedItems
Gets or sets the selected items in the NodifyEditor.
public IList SelectedItems { get; set; }
Property Value
SelectionRectangleStyle
Gets or sets the style to use for the selection rectangle.
public Style SelectionRectangleStyle { get; set; }
Property Value
ViewportLocation
Gets or sets the viewport's top-left coordinates in graph space coordinates.
public Point ViewportLocation { get; set; }
Property Value
ViewportSize
Gets the size of the viewport in graph space (scaled by the NodifyEditor.ViewportZoom).
public Size ViewportSize { get; set; }
Property Value
ViewportTransform
Gets the transform that is applied to all child controls.
public Transform ViewportTransform { get; set; }
Property Value
ViewportZoom
Gets or sets the zoom factor of the viewport.
public double ViewportZoom { get; set; }
Property Value
Methods
ActivateNavigationLayer(KeyboardNavigationLayerId)
public virtual bool ActivateNavigationLayer(KeyboardNavigationLayerId layerId);
Parameters
layerId KeyboardNavigationLayerId
Returns
ActivateNextNavigationLayer()
public virtual bool ActivateNextNavigationLayer();
Returns
ActivatePreviousNavigationLayer()
public virtual bool ActivatePreviousNavigationLayer();
Returns
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)
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)
public void BringIntoView(Rect area, double offsetFromEdge = 32d);
Parameters
area Rect
offsetFromEdge Double
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();
FindNextFocusTarget(ItemContainer, TraversalRequest)
protected virtual ItemContainer FindNextFocusTarget(ItemContainer currentContainer, TraversalRequest request);
Parameters
currentContainer ItemContainer
request TraversalRequest
Returns
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
GetEnumerator()
public virtual IEnumerator<IKeyboardNavigationLayer> GetEnumerator();
Returns
IEnumerator<IKeyboardNavigationLayer>
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
LockSelection()
Locks the position of the NodifyEditor.SelectedContainers.
public void LockSelection();
MoveFocus(FocusNavigationDirection)
public bool MoveFocus(FocusNavigationDirection direction);
Parameters
direction FocusNavigationDirection
Returns
MoveFocus(TraversalRequest)
public bool MoveFocus(TraversalRequest request);
Parameters
request TraversalRequest
Returns
OnApplyTemplate()
public override void OnApplyTemplate();
OnElementFocused(IKeyboardFocusTarget<ItemContainer>)
protected virtual void OnElementFocused(IKeyboardFocusTarget<ItemContainer> target);
Parameters
target IKeyboardFocusTarget<ItemContainer>
OnGotKeyboardFocus(KeyboardFocusChangedEventArgs)
protected override void OnGotKeyboardFocus(KeyboardFocusChangedEventArgs e);
Parameters
e KeyboardFocusChangedEventArgs
OnKeyboardNavigationLayerActivated(IKeyboardNavigationLayer)
protected virtual void OnKeyboardNavigationLayerActivated(IKeyboardNavigationLayer activeLayer);
Parameters
activeLayer IKeyboardNavigationLayer
OnKeyDown(KeyEventArgs)
protected override void OnKeyDown(KeyEventArgs e);
Parameters
OnKeyUp(KeyEventArgs)
protected override void OnKeyUp(KeyEventArgs e);
Parameters
OnLostKeyboardFocus(KeyboardFocusChangedEventArgs)
protected override void OnLostKeyboardFocus(KeyboardFocusChangedEventArgs e);
Parameters
e KeyboardFocusChangedEventArgs
OnLostMouseCapture(MouseEventArgs)
protected override void OnLostMouseCapture(MouseEventArgs e);
Parameters
OnMouseDown(MouseButtonEventArgs)
protected override void OnMouseDown(MouseButtonEventArgs e);
Parameters
OnMouseMove(MouseEventArgs)
protected override void OnMouseMove(MouseEventArgs e);
Parameters
OnMouseUp(MouseButtonEventArgs)
protected override void OnMouseUp(MouseButtonEventArgs e);
Parameters
OnMouseWheel(MouseWheelEventArgs)
protected override void OnMouseWheel(MouseWheelEventArgs e);
Parameters
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
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)
public virtual bool RegisterNavigationLayer(IKeyboardNavigationLayer layer);
Parameters
layer IKeyboardNavigationLayer
Returns
RemoveNavigationLayer(KeyboardNavigationLayerId)
public virtual bool RemoveNavigationLayer(KeyboardNavigationLayerId layerId);
Parameters
layerId KeyboardNavigationLayerId
Returns
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)
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 viewport's center.
public void ZoomIn();
ZoomOut()
Zoom out at the viewport's center.
public void ZoomOut();
Events
ActiveNavigationLayerChanged
public virtual event Action<KeyboardNavigationLayerId> ActiveNavigationLayerChanged;
Event Type
Action<KeyboardNavigationLayerId>
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
Occurs whenever the viewport updates.
public event RoutedEventHandler ViewportUpdated;
Event Type