Fires when the layout item's selection state is about to be changed.
public event LayoutItemSelectionChangingEventHandler LayoutItemSelectionChanging
Public Event LayoutItemSelectionChanging As LayoutItemSelectionChangingEventHandler
The LayoutItemSelectionChanging event's data class is LayoutItemSelectionChangingEventArgs. The following properties provide information specific to this event:
|Cancel||Gets or sets whether the current operation must be canceled. Inherited from ItemCancelEventArgs.|
|Handled||Gets or sets a value that indicates the present state of the event handling for a routed event as it travels the route. Inherited from RoutedEventArgs.|
|Item||Gets the currently processed item. Inherited from ItemEventArgs.|
|OriginalSource||Gets the original reporting source as determined by pure hit testing, before any possible Source adjustment by a parent class. Inherited from RoutedEventArgs.|
|RoutedEvent||Gets or sets the RoutedEvent associated with this RoutedEventArgs instance. Inherited from RoutedEventArgs.|
|Selected||Gets whether the item is selected.|
|Source||Gets or sets a reference to the object that raised the event. Inherited from RoutedEventArgs.|
The event data class exposes the following methods:
|InvokeEventHandler(Delegate, Object)||When overridden in a derived class, provides a way to invoke event handlers in a type-specific way, which can increase efficiency over the base implementation. Inherited from RoutedEventArgs.|
|OnSetSource(Object)||When overridden in a derived class, provides a notification callback entry point whenever the value of the Source property of an instance changes. Inherited from RoutedEventArgs.|
An end-user can select a layout item in Customization Mode by clicking the item; and deselect the item by clicking it while holding the CTRL key down. If an item is selected or allows selection, it's possible to invoke its customization context menu by right-clicking the item. In addition, the items that allow selection can be moved via drag-and-drop.
To prevent an item's selection state from being changed, you can do one of the following:
- Set the BaseLayoutItem.AllowSelection property to false.
- Handle the DockLayoutManager.LayoutItemSelectionChanging event and set the event's Cancel parameter to true.
The LayoutItemSelectionChanging is just a notification event that fires after an item has been successfully selected/deselected.