3. Introduction
it is an advanced Items Control that has
a multiple selection mode that allows
users to select multiple items from a list.
This is usually used in scenarios where the
same action has to be applied over
multiple items.
4. Key Properties
IsSelectionEnabled
IsSelectionEnabled is a dependency property
of type bool. It gets or sets the flag that
indicates whether the list is in selection mode
or not.
ItemInfoTemplate
ItemInfoTemplate is a dependency property
of type DataTemplate. It gets or sets the data
template that is to be used on the item
information field of the MultiselectItems.
5. Continued …..
ItemContainerStyle
ItemContainerStyle is a dependency
property of type Style. It determines the
Style that is applied to the MultiselectList
control items.
SelectedItems
SelectedItems is a read only property of
type IList. It gets the collection of items
that are currently selected.
6. continued…
IsSelectionEnabledChanged
Occurs when the value of the IsSelectionEnabled
property has changed.
multiselectList.IsSelectionEnabledChanged += new
DependencyPropertyChangedEventHandler(multisel
ectList_IsSelectionEnabledChanged);
void
multiselectList_IsSelectionEnabledChanged(object
sender, DependencyPropertyChangedEventArgs e)
{//...}
8. C#:
Define an instance of Multiselectlist
control in class:
MultiselectList list = new MultiselectList();
list.Items.Add(new MultiselectItem() {
Content = "Item1"});
list.Items.Add(new MultiselectItem() {
Content = "Item2" });
list.Items.Add(new MultiselectItem() {
Content = "Item3" });
9. KeyEvents
SelectionChanged
Occurs when there is a change in the
SelectedItems collection
multiselectList.SelectionChanged += new
SelectionChangedEventHandler(multiselectLis
t_SelectionChanged);
void multiselectList_SelectionChanged(object
sender, SelectionChangedEventArgs e)
{//...}