ItemContainer
ItemContainer Class
Section titled “ItemContainer Class”Namespace: Nodify
Assembly: Nodify
Inheritance: Object → DispatcherObject → DependencyObject → Visual → UIElement → FrameworkElement → Control → ContentControl → ItemContainer
Implements: INodifyCanvasItem, IKeyboardFocusTarget<ItemContainer>
References: Connector, ContainerState.Default, EditorCommands, GroupingNode, InputProcessor, ItemsMovedEventArgs, NodifyEditor, PendingConnection, PreviewLocationChanged, SelectionType
The container for all the items generated by the ItemsControl.ItemsSource of the NodifyEditor.
public class ItemContainer : ContentControl, INodifyCanvasItem, IKeyboardFocusTarget<ItemContainer>
Constructors
Section titled “Constructors”ItemContainer(NodifyEditor)
Section titled “ItemContainer(NodifyEditor)”Constructs an instance of an ItemContainer in the specified NodifyEditor.
public ItemContainer(NodifyEditor editor);
Parameters
editor
NodifyEditor
Fields
Section titled “Fields”IsPreviewingSelectionPropertyKey
Section titled “IsPreviewingSelectionPropertyKey”protected static DependencyPropertyKey IsPreviewingSelectionPropertyKey;
Field Value
Properties
Section titled “Properties”ActualSize
Section titled “ActualSize”Gets the actual size of this ItemContainer.
public Size ActualSize { get; set; }
Property Value
Bounds
Section titled “Bounds”Gets the bounds of the selection area for this ItemContainer based on its ItemContainer.Location and ItemContainer.DesiredSizeForSelection.
public virtual Rect Bounds { get; set; }
Property Value
DesiredSizeForSelection
Section titled “DesiredSizeForSelection”Overrides the size to check against when calculating if this ItemContainer can be part of the current NodifyEditor.SelectedArea. Defaults to UIElement.RenderSize.
public Size? DesiredSizeForSelection { get; set; }
Property Value
Editor
Section titled “Editor”The NodifyEditor that owns this ItemContainer.
public NodifyEditor Editor { get; set; }
Property Value
HasContextMenu
Section titled “HasContextMenu”Gets a value indicating whether the container has a context menu.
public bool HasContextMenu { get; set; }
Property Value
HasCustomContextMenu
Section titled “HasCustomContextMenu”Gets or sets a value indicating whether the container uses a custom context menu.
public bool HasCustomContextMenu { get; set; }
Property Value
HighlightBrush
Section titled “HighlightBrush”Gets or sets the brush used when the PendingConnection.IsOverElementProperty attached property is true for this ItemContainer.
public Brush HighlightBrush { get; set; }
Property Value
InputProcessor
Section titled “InputProcessor”protected InputProcessor InputProcessor { get; set; }
Property Value
IsDraggable
Section titled “IsDraggable”Gets or sets whether this ItemContainer can be dragged.
public bool IsDraggable { get; set; }
Property Value
IsPreviewingLocation
Section titled “IsPreviewingLocation”Gets a value indicating whether this ItemContainer is previewing a new location but didn’t logically move there.
public bool IsPreviewingLocation { get; set; }
Property Value
IsPreviewingSelection
Section titled “IsPreviewingSelection”Gets a value indicating whether this ItemContainer is about to change its ItemContainer.IsSelected state.
public Boolean? IsPreviewingSelection { get; set; }
Property Value
IsSelectable
Section titled “IsSelectable”Gets or sets whether this ItemContainer can be selected.
public bool IsSelectable { get; set; }
Property Value
IsSelected
Section titled “IsSelected”Gets or sets a value that indicates whether this ItemContainer is selected. Can only be set if ItemContainer.IsSelectable is true.
public bool IsSelected { get; set; }
Property Value
Location
Section titled “Location”Gets or sets the location of this ItemContainer inside the NodifyEditor in graph space coordinates.
public virtual Point Location { get; set; }
Property Value
PreserveSelectionOnRightClick
Section titled “PreserveSelectionOnRightClick”Indicates whether right-click on the container should preserve the current selection.
public static bool PreserveSelectionOnRightClick { get; set; }
Property Value
SelectedBorderThickness
Section titled “SelectedBorderThickness”Gets or sets the border thickness used when ItemContainer.IsSelected or ItemContainer.IsPreviewingSelection is true.
public Thickness SelectedBorderThickness { get; set; }
Property Value
SelectedBrush
Section titled “SelectedBrush”Gets or sets the brush used when ItemContainer.IsSelected or ItemContainer.IsPreviewingSelection is true.
public Brush SelectedBrush { get; set; }
Property Value
SelectedMargin
Section titled “SelectedMargin”The calculated margin when the container is selected or previewing selection.
public Thickness SelectedMargin { get; set; }
Property Value
Methods
Section titled “Methods”BeginDragging()
Section titled “BeginDragging()”public void BeginDragging();
CancelDragging()
Section titled “CancelDragging()”public void CancelDragging();
EndDragging()
Section titled “EndDragging()”public void EndDragging();
IsSelectableInArea(Rect, Boolean)
Section titled “IsSelectableInArea(Rect, Boolean)”Checks if area contains or intersects with this ItemContainer taking into consideration the ItemContainer.DesiredSizeForSelection.
public virtual bool IsSelectableInArea(Rect area, bool isContained);
Parameters
area
Rect: The area to check if contains or intersects this ItemContainer.
isContained
Boolean: If true will check if area contains this, otherwise will check if area intersects with this.
Returns
Boolean: True if area contains or intersects this ItemContainer.
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
OnLocationChanged()
Section titled “OnLocationChanged()”Raises the ItemContainer.LocationChangedEvent and sets ItemContainer.IsPreviewingLocation to false.
protected void OnLocationChanged();
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
OnRenderSizeChanged(SizeChangedInfo)
Section titled “OnRenderSizeChanged(SizeChangedInfo)”protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo);
Parameters
sizeInfo
SizeChangedInfo
OnSelectedChanged(Boolean)
Section titled “OnSelectedChanged(Boolean)”Raises the ItemContainer.SelectedEvent or ItemContainer.UnselectedEvent based on newValue. Called when the ItemContainer.IsSelected value is changed.
protected void OnSelectedChanged(bool newValue);
Parameters
newValue
Boolean: True if selected, false otherwise.
OnVisualParentChanged(DependencyObject)
Section titled “OnVisualParentChanged(DependencyObject)”protected override void OnVisualParentChanged(DependencyObject oldParent);
Parameters
oldParent
DependencyObject
Select(SelectionType)
Section titled “Select(SelectionType)”Modifies the selection state of the current item based on the specified selection type.
public void Select(SelectionType type);
Parameters
type
SelectionType: The type of selection to perform.
UpdateDragging(Vector)
Section titled “UpdateDragging(Vector)”public void UpdateDragging(Vector amount);
Parameters
amount
Vector
Events
Section titled “Events”LocationChanged
Section titled “LocationChanged”Occurs when the ItemContainer.Location of this ItemContainer is changed.
public event RoutedEventHandler LocationChanged;
Event Type
PreviewLocationChanged
Section titled “PreviewLocationChanged”Occurs when the ItemContainer is previewing a new location.
public event PreviewLocationChanged PreviewLocationChanged;
Event Type
Selected
Section titled “Selected”Occurs when this ItemContainer is selected.
public event RoutedEventHandler Selected;
Event Type
Unselected
Section titled “Unselected”Occurs when this ItemContainer is unselected.
public event RoutedEventHandler Unselected;
Event Type