コード例 #1
0
        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);
                }
            }
        }
コード例 #2
0
        //Message from Widget Manager
        private void WdgMgrChangeSelectionHandler(object parameter)
        {
            WidgetSelectionInfoExtra info = (WidgetSelectionInfoExtra)parameter;

            //if (info.IsSwipePanel)
            //{
            //    return;
            //}

            if (info.pageType == PageType.NormalPage)
            {
                //Open page when the target page is close now
                PageEditorViewModel page = OpenNormalPage(info.PageID, info.WidgetID, info.bSelected, info.IsGroup);
                if (page != null)
                {
                    //Select the target widget  and locate it correctly.
                    page.WdgMgrSetTargeComponent(info.WidgetID, info.bSelected, info.IsGroup);
                    page.SelectTargetComponent();
                }
            }
            else if (info.pageType == PageType.ToastPage || info.pageType == PageType.HamburgerPage)
            {
                //Open page when the target page is close now
                PageEditorViewModel page = OpenWidgetPage(info.BelongWidget, info.WidgetID, info.bSelected, info.IsGroup);
                if (page != null)
                {
                    //Select the target widget  and locate it correctly.
                    page.WdgMgrSetTargeComponent(info.WidgetID, info.bSelected, info.IsGroup);
                    page.SelectTargetComponent();
                }
            }
            else if (info.pageType == PageType.DynamicPanelPage)
            {
                if (info.IsSwipePanel == true && info.bSelected == false)
                {
                    return;
                }
                else if (info.IsSwipePanel == true && info.bSelected == true)
                {
                    OpenSwipePage(info.BelongWidget, info.PageID, Guid.Empty, true, false);
                    return;
                }

                //Open page when the target page is close now
                PageEditorViewModel page = OpenSwipePage(info.BelongWidget, info.PageID, info.WidgetID, info.bSelected, info.IsGroup);
                if (page != null)
                {
                    //Select the target widget  and locate it correctly.
                    page.WdgMgrSetTargeComponent(info.WidgetID, info.bSelected, info.IsGroup);
                    page.SelectTargetComponent();
                }
            }
        }