Nodify_ItemContainer - miroiu/nodify GitHub Wiki
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> Constructs an instance of an ItemContainer in the specified NodifyEditor.
public ItemContainer(NodifyEditor editor); Parameters
editor NodifyEditor
protected static DependencyPropertyKey IsPreviewingSelectionPropertyKey; Field Value
Gets the actual size of this ItemContainer.
public Size ActualSize { get; set; } Property Value
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
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
The NodifyEditor that owns this ItemContainer.
public NodifyEditor Editor { get; set; } Property Value
Gets a value indicating whether the container has a context menu.
public bool HasContextMenu { get; set; } Property Value
Gets or sets a value indicating whether the container uses a custom context menu.
public bool HasCustomContextMenu { get; set; } Property Value
Gets or sets the brush used when the PendingConnection.IsOverElementProperty attached property is true for this ItemContainer.
public Brush HighlightBrush { get; set; } Property Value
protected InputProcessor InputProcessor { get; set; } Property Value
Gets or sets whether this ItemContainer can be dragged.
public bool IsDraggable { get; set; } Property Value
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
Gets a value indicating whether this ItemContainer is about to change its ItemContainer.IsSelected state.
public Boolean? IsPreviewingSelection { get; set; } Property Value
Gets or sets whether this ItemContainer can be selected.
public bool IsSelectable { get; set; } Property Value
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
Gets or sets the location of this ItemContainer inside the NodifyEditor in graph space coordinates.
public virtual Point Location { get; set; } Property Value
Indicates whether right-click on the container should preserve the current selection.
public static bool PreserveSelectionOnRightClick { get; set; } Property Value
Gets or sets the border thickness used when ItemContainer.IsSelected or ItemContainer.IsPreviewingSelection is true.
public Thickness SelectedBorderThickness { get; set; } Property Value
Gets or sets the brush used when ItemContainer.IsSelected or ItemContainer.IsPreviewingSelection is true.
public Brush SelectedBrush { get; set; } Property Value
The calculated margin when the container is selected or previewing selection.
public Thickness SelectedMargin { get; set; } Property Value
public void BeginDragging(); public void CancelDragging(); public void EndDragging(); 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.
protected override void OnKeyDown(KeyEventArgs e); Parameters
protected override void OnKeyUp(KeyEventArgs e); Parameters
Raises the ItemContainer.LocationChangedEvent and sets ItemContainer.IsPreviewingLocation to false.
protected void OnLocationChanged(); protected override void OnLostMouseCapture(MouseEventArgs e); Parameters
protected override void OnMouseDown(MouseButtonEventArgs e); Parameters
protected override void OnMouseMove(MouseEventArgs e); Parameters
protected override void OnMouseUp(MouseButtonEventArgs e); Parameters
protected override void OnMouseWheel(MouseWheelEventArgs e); Parameters
protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo); Parameters
sizeInfo SizeChangedInfo
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.
protected override void OnVisualParentChanged(DependencyObject oldParent); Parameters
oldParent DependencyObject
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.
public void UpdateDragging(Vector amount); Parameters
amount Vector
Occurs when the ItemContainer.Location of this ItemContainer is changed.
public event RoutedEventHandler LocationChanged; Event Type
Occurs when the ItemContainer is previewing a new location.
public event PreviewLocationChanged PreviewLocationChanged; Event Type
Occurs when this ItemContainer is selected.
public event RoutedEventHandler Selected; Event Type
Occurs when this ItemContainer is unselected.
public event RoutedEventHandler Unselected; Event Type