private void DeselectAllWidgets() { if (_pageVM != null) { foreach (IWidgetPropertyData widget in _pageVM.GetSelectedwidgets()) { WidgetViewModBase widgetVM = widget as WidgetViewModBase; if (widgetVM != null) { if (widgetVM.IsGroup) { // Group VM has IsSelected and GroupStatus.UnSelect property, set GroupStatus will also set IsSelected, but set // set IsSelected will not set status, they are not synchronized. We use status to set group selection in undo/redo. // See SelectCommand. IGroupOperation pageVM = _pageVM as IGroupOperation; if (pageVM != null) { pageVM.SetGroupStatus(widgetVM.widgetGID, GroupStatus.UnSelect); } } else { widgetVM.Raw_IsSelected = false; } } } } }
public SelectCommand(IGroupOperation pageVM, WidgetViewModBase selectedWidget) { List <WidgetViewModBase> selectedWidgetList = new List <WidgetViewModBase>(); selectedWidgetList.Add(selectedWidget); CheckGroupHelper(selectedWidgetList); _pageVM = pageVM; }
private void AddToList(WidgetViewModBase item) { if (item != null) { if (item.IsGroup) { _groupGuids.Add(item.WidgetID); } else { _widgetList.Add(item); } } }