/// <summary> /// Add the selected item from the UpDownListView /// </summary> public void Add() { if (ListItems == null || ListItems.Count == 0) { return; } if (AvailableListItems == null) { AvailableListItems = new ObservableCollection <ListItem>(); } var selectedIndex = 0; var count = ListItems.Count; for (int j = 0; j < count; j++) { selectedIndex = count - j - 1; ListItem item = ListItems[selectedIndex]; if (item.IsSelected == false) { continue; } AvailableListItems.Add(item); ListItems.Remove(item); } }
/// <summary> /// Add all items from the UpDownListView /// </summary> public void AddAll() { if (ListItems == null || ListItems.Count == 0) { return; } if (AvailableListItems == null) { AvailableListItems = new ObservableCollection <ListItem>(); } int count = ListItems.Count; for (int i = 0; i < count; i++) { var item = ListItems[0]; ListItems.RemoveAt(0); AvailableListItems.Add(item); } }