Table of Contents

Class MultiSelectionHelper

Namespace
Loehnert.Utility.Wpf
Assembly
Loehnert.Utility.dll

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

DependencyProperty

SelectedItemsProperty

Gets the dependency property for the selected items.

public static readonly DependencyProperty SelectedItemsProperty

Field Value

DependencyProperty

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 UIElement

Element 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 UIElement

Element 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

element UIElement

Element with the dependency property.

value bool

Value to set.

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)

Parameters

element UIElement

Element with the dependency property.

value IList

Value to set.