Represents a set of items selected in the diagram document.
Namespace: MindFusion.Diagramming
Assembly: MindFusion.Diagramming
C#
![]() |
---|
public class Selection : DiagramItem |
Visual Basic
![]() |
---|
Public Class Selection |
In a diagram document, several items can be selected simultaneously. If more than one item is selected, the compound set of selected items is handled by an instance of the Selection class.
In a diagram document several items can be selected simultaneously. If more than one item is selected, the compound set of selected items is handled by an instance of the Selection class. Items in the selection can be of any element type. The Items property gives a collection of all the items in the selection. You can get type-safe access to items of specific class by the Links and Nodes collections properties.
Users can select multiple items by drawing a selection rectangle. Depending on the Diagram's Behavior, this is done either by simply dragging the mouse, or by holding CTRL down while dragging the mouse. It is possible to prevent users from selecting more than one items at the same time by setting AllowMultipleSelection to false.
Items can be always added or removed programmatically to selection by calling the AddItem and RemoveItem methods. Selection state of an item can be toggled, getting deselected from selected and vice versa, by calling the Toggle method. All items in the selection are deselected if Clear is invoked.
Use the Selected property of the DiagramItem class to determine whether a particular item is selected.
System.Object
Windows.UI.Xaml.DependencyObject
Windows.UI.Xaml.UIElement
Windows.UI.Xaml.FrameworkElement
Windows.UI.Xaml.Controls.Control
Windows.UI.Xaml.Controls.ContentControl
MindFusion.Diagramming.DiagramItem
MindFusion.Diagramming.Selection