Class MultiSelectionHelper
Represents a behavior for binding to the selected items of a DataGrid. Supports MultiSelector (e. g. DataGrid) and ListBox.
public static class MultiSelectionHelper
- Inheritance
-
MultiSelectionHelper
- Inherited Members
Examples
<UserControl xmlns:u="http://lisrt.de/utility">
<DataGrid u:MultiSelectionHelper.SelectedItems="{Binding InDataGridSelecteItems}"/>
</UserControl>
public ObservableCollection<MyDataGridItem> InDataGridSelecteItems { get; } = new ObservableCollection<MyDataGridItem>();
Fields
IsSubscribedToSelectionChangedProperty
Gets the dependency property which indicates if a control is subscribed.
public static readonly DependencyProperty IsSubscribedToSelectionChangedProperty
Field Value
SelectedItemsProperty
Gets the dependency property for the selected items.
public static readonly DependencyProperty SelectedItemsProperty
Field Value
Methods
GetIsSubscribedToSelectionChanged(UIElement)
Gets the value of the is subscribed to selection property for the element
.
[AttachedPropertyBrowsableForType(typeof(ListBox))]
[AttachedPropertyBrowsableForType(typeof(MultiSelector))]
public static bool GetIsSubscribedToSelectionChanged(UIElement element)
Parameters
element
UIElementElement with the dependency property.
Returns
- bool
The current value of the selected items property.
GetSelectedItems(UIElement)
Gets the value of the selected items property for the element
.
[AttachedPropertyBrowsableForType(typeof(ListBox))]
[AttachedPropertyBrowsableForType(typeof(MultiSelector))]
public static IList GetSelectedItems(UIElement element)
Parameters
element
UIElementElement with the dependency property.
Returns
- IList
The current value of the selected items property.
SetIsSubscribedToSelectionChanged(UIElement, bool)
Sets the value of the is subscribed to selection property for the element
.
public static void SetIsSubscribedToSelectionChanged(UIElement element, bool value)
Parameters
SetSelectedItems(UIElement, IList)
Sets the value of the selected items property for the element
.
[AttachedPropertyBrowsableForType(typeof(ListBox))]
[AttachedPropertyBrowsableForType(typeof(MultiSelector))]
public static void SetSelectedItems(UIElement element, IList value)