public void ListItemSelectedChangedNotify(object data) { WidgetSelectionInfo info = (WidgetSelectionInfo)data; WidgetListItem curitem = null; curitem = FindUIItemByGUID(info.WidgetID); if (curitem != null) { if (curitem.ItemType == ListItemType.GroupChildItem) { curitem.UpdateItemSelectInfo(false); } else { if (info.bSelected) { foreach (Guid ItemID in _oldSelectedList) { WidgetListItem tempitem = FindItemByGUID(ItemID); if ((tempitem != null && tempitem.IsSelected == true) && curitem.ParentID != tempitem.ParentID) { curitem.UpdateItemSelectInfo(false); return; } } if (curitem.PlaceFlag == true) { _oldSelectedList.Add(info.WidgetID); RefreshToolbarCommands(); return; } } else { if (curitem.PlaceFlag == true) { _oldSelectedList.Remove(info.WidgetID); return; } } WidgetSelectionInfoExtra Notifydata = new WidgetSelectionInfoExtra(); Notifydata.WidgetID = curitem.WidgetID; Notifydata.bSelected = info.bSelected; Notifydata.PageID = curitem.ParentPage.Guid; Notifydata.BelongWidget = WidgetListItem.BelongWidget; Notifydata.pageType = GetparentType(curitem.ParentPage); Notifydata.IsGroup = (curitem.ItemType == ListItemType.GroupItem); Notifydata.IsSwipePanel = (curitem.ItemType == ListItemType.DynamicPanelStateItem); _ListEventAggregator.GetEvent <WdgMgrChangeSelectionEvent>().Publish(Notifydata); } } }
//this function is not used now, ignore it public void WdgMgrChangeSelection(object parameter) { WidgetSelectionInfo info = (WidgetSelectionInfo)parameter; List <IWidgetPropertyData> allwidgets = this.GetAllWidgets(); foreach (IWidgetPropertyData item in allwidgets) { if (item.WidgetID.Equals(info.WidgetID)) { ((WidgetViewModBase)item).IsSelected = info.bSelected; break; } } }