Search
Selection Class
Remarks See Also
 





Represents a set of items selected in the diagram document.

Namespace: MindFusion.Diagramming.Wpf
Assembly: MindFusion.Diagramming.Wpf

 Syntax

C#  Copy Code

public class Selection : DiagramItem

Visual Basic  Copy Code

Public Class Selection
    Inherits DiagramItem

 Remarks

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 view's Behavior, this is done either by simply dragging the mouse, or by holding CTRL down while dragging the mouse. Depending on the IncludeItemsIfIntersect value, items are selected if they are entirely inside the drawn selection rectangle, or if at least a part of them is inside the rectangle. 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 the AddItem method and RemoveItem method. Selection state of an item can be toggled, getting deselected from selected and vice versa, by 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. The Selection's GetSize method returns how many items are selected. Bounds returns the rectangle that bounds all selected items.

The visual style of multiple-selection is defined by the Style property. For example selection might be painted as a dashed rectangle or a semi-transparent filled rectangle.

 Inheritance Hierarchy

System.Object
    System.Windows.Threading.DispatcherObject
        System.Windows.DependencyObject
            System.Windows.Media.Visual
                System.Windows.UIElement
                    System.Windows.FrameworkElement
                        MindFusion.Diagramming.Wpf.DiagramItem
                            MindFusion.Diagramming.Wpf.Selection

 See Also