//private void Select(List<PlanObjectItem> items) //{ // if (!IsUpdatingSelectedItems) // { // BeginUpdateSelectedItems(); // items.ForEach(a => // { // SelectedItems.Add((BaseObject)ItemContainerGenerator.ItemFromContainer(a)); // a.IsSelected = true; // } // ); // EndUpdateSelectedItems(); // } //} private void Unselect(PlanObjectItem item) { if (!IsUpdatingSelectedItems) { BeginUpdateSelectedItems(); SelectedItems.Remove((BaseObject)ItemContainerGenerator.ItemFromContainer(item)); item.IsSelected = false; /* ----!---- */ SelectedRooms.Remove((Room)ItemContainerGenerator.ItemFromContainer(item)); EndUpdateSelectedItems(); } }
internal void NotifyItemClicked(PlanObjectItem item) { if (!CanSelect) return; var dataItem = (BaseObject)ItemContainerGenerator.ItemFromContainer(item); if (!(dataItem is Room)) return; if (SelectedItems.Contains(dataItem)) Unselect(item); else Select(item); }
internal void NotifyItemClicked(PlanObjectItem item) { if (!CanSelect) { return; } var dataItem = (BaseObject)ItemContainerGenerator.ItemFromContainer(item); if (!(dataItem is Room)) { return; } if (SelectedItems.Contains(dataItem)) { Unselect(item); } else { Select(item); } }
//private void Select(List<PlanObjectItem> items) //{ // if (!IsUpdatingSelectedItems) // { // BeginUpdateSelectedItems(); // items.ForEach(a => // { // SelectedItems.Add((BaseObject)ItemContainerGenerator.ItemFromContainer(a)); // a.IsSelected = true; // } // ); // EndUpdateSelectedItems(); // } //} private void Unselect(PlanObjectItem item) { if (!IsUpdatingSelectedItems) { BeginUpdateSelectedItems(); SelectedItems.Remove((BaseObject)ItemContainerGenerator.ItemFromContainer(item)); item.IsSelected = false; /* ----!---- */ SelectedRooms.Remove((Room)ItemContainerGenerator.ItemFromContainer(item)); EndUpdateSelectedItems(); } }