I have Flags Enum value which I have bound into the item source of listbox. I have used SelectionMode
as multiple. I want assign all the selected items of the listbox to a flag Enum property. How can I bind the selected items?
private void ListBox_SelectionChanged(object sender,SelectionChangedEventArgs e)
{
ListBox list = sender as ListBox;
this.Weekdays=list.SelectedItems.GetType().GetEnumValues().GetEnumerator()
as Weekdays;
}
Here weekdays is Flags-Enum of type Weekdays.I want bind all the selected items of listbox to Weekdays.