Ejemplo n.º 1
0
        private void UpdatePaneState()
        {
            if (PaneSitemap != null)
            {
                OpenPaneState(PaneSitemap);
            }
            if (PaneWidgets != null)
            {
                OpenPaneState(PaneWidgets);
            }
            if (PaneMaster != null)
            {
                OpenPaneState(PaneMaster);
            }
            if (PaneInteraction != null)
            {
                OpenPaneState(PaneInteraction);
            }
            if (PaneWidgetProp != null)
            {
                OpenPaneState(PaneWidgetProp);
            }
            if (PanePageProp != null && _document != null && _document.DocumentType == DocumentType.Standard)
            {
                OpenPaneState(PanePageProp);
                PanePageIcon.Hide();
                //AdaptiveModel.GetInstance().IsPagePropOpen = PanePageProp.IsVisible;
                foreach (PageEditorViewModel item in EditPages.OfType <PageEditorViewModel>())
                {
                    if (item == null)
                    {
                        continue;
                    }
                    item.SetAdaptiveViewVisibility(PanePageProp.IsVisible);
                }
            }
            if (PanePageIcon != null && _document != null && _document.DocumentType == DocumentType.Library)
            {
                OpenPaneState(PanePageIcon);
                PanePageProp.Hide();
            }

            if (PaneWidgetManager != null)
            {
                OpenPaneState(PaneWidgetManager);
            }
        }
Ejemplo n.º 2
0
        public void OpenMasterPageEventHandler(Guid pageGID)
        {
            //Active an exist page editor,20140220
            var exitPage = EditPages.OfType <MasterPageEditorViewModel>().FirstOrDefault(a => a.ContentId == pageGID.ToString());

            if (exitPage != null)
            {
                exitPage.IsActive          = true;
                exitPage.IsNeedReturnFocus = true;
                return;
            }

            DeselectAllPages();
            //Create a new page editor,20140220

            var page = new MasterPageEditorViewModel(pageGID);

            page.Open();
            EditPages.Add(page);
            page.IsActive = true;
            page.Update();

            page.IsNeedReturnFocus = true;
        }
Ejemplo n.º 3
0
        private PageEditorViewModel OpenSwipePage(IWidget widget, Guid childPageGID, Guid SelWdgGID, bool bIsSelect, bool bIsGroup)
        {
            PageEditorViewModel newPage           = null;
            ISelectionService   _selectionService = ServiceLocator.Current.GetInstance <SelectionServiceProvider>();
            IPagePropertyData   activePage        = _selectionService.GetCurrentPage();

            Guid parentGID = widget.ParentPage.Guid;

            if (widget.WidgetType != WidgetType.DynamicPanel)
            {
                return(null);
            }


            //Active an exist page editor,20140220
            DynamicPageEditorViewModel CurrentDynmicPanel = null;

            foreach (var pageItem in EditPages.OfType <DynamicPageEditorViewModel>())
            {
                if (pageItem.ContentId == widget.Guid.ToString())
                {
                    CurrentDynmicPanel = pageItem;
                    if (pageItem.ActivePage.Guid == childPageGID)
                    {
                        pageItem.IsActive = true;
                        return(pageItem);
                    }
                    break;
                }
            }

            //Only Update the target panel
            if (CurrentDynmicPanel != null)
            {
                //TODO:???????
                CurrentDynmicPanel.IsActive = true;
                foreach (DynamicChildNodViewModel item in CurrentDynmicPanel.DynamicChildren)
                {
                    if (item.GID == childPageGID)
                    {
                        CurrentDynmicPanel.WdgMgrSetTargeComponent(SelWdgGID, bIsSelect, bIsGroup);
                        item.IsChecked = true;
                        break;
                    }
                }
                return(null);
            }

            DeselectAllPages();

            //Create a new page with target panel
            newPage = new DynamicPageEditorViewModel(widget, childPageGID);
            newPage.WdgMgrSetTargeComponent(SelWdgGID, bIsSelect, bIsGroup);

            //if child page is not set(value is 100%)
            //Set scale the same as parent page(only create child page, not active child page)
            if (newPage.EditorScale == 1)
            {
                newPage.EditorScale = activePage.EditorScale;
            }
            newPage.Open();
            EditPages.Add(newPage);
            newPage.IsActive = true;
            newPage.Update();
            return(null);
        }
Ejemplo n.º 4
0
        private PageEditorViewModel OpenWidgetPage(IWidget widget, Guid SelWdgGID, bool bIsSelect, bool bIsgroup)
        {
            PageEditorViewModel newPage           = null;
            ISelectionService   _selectionService = ServiceLocator.Current.GetInstance <SelectionServiceProvider>();
            IPagePropertyData   activePage        = _selectionService.GetCurrentPage();

            Guid parentGID = widget.ParentPage.Guid;

            switch (widget.WidgetType)
            {
            case WidgetType.DynamicPanel:
            {
                //Active an exist page editor,20140220
                foreach (var pageItem in EditPages.OfType <DynamicPageEditorViewModel>())
                {
                    if (pageItem.ContentId == widget.Guid.ToString())
                    {
                        pageItem.IsActive = true;
                        return(pageItem);
                    }
                }

                ////Create a new page editor,20140220
                newPage = new DynamicPageEditorViewModel(widget);
                newPage.WdgMgrSetTargeComponent(SelWdgGID, bIsSelect, bIsgroup);
                break;
            }

            case WidgetType.Toast:
            {
                foreach (var pageItem in EditPages.OfType <ToastPageEditorViewModel>())
                {
                    if (pageItem.ContentId == widget.Guid.ToString())
                    {
                        pageItem.IsActive = true;
                        return(pageItem);
                    }
                }

                newPage = new ToastPageEditorViewModel(widget);
                newPage.WdgMgrSetTargeComponent(SelWdgGID, bIsSelect, bIsgroup);
                break;
            }

            case WidgetType.HamburgerMenu:
            {
                //Active an exist page editor,20140220
                foreach (var pageItem in EditPages.OfType <HamburgerPageEditorViewModel>())
                {
                    if (pageItem.ContentId == widget.Guid.ToString())
                    {
                        pageItem.IsActive = true;
                        return(pageItem);
                    }
                }
                //Create a new page editor,20140220
                newPage = new HamburgerPageEditorViewModel(widget);
                newPage.WdgMgrSetTargeComponent(SelWdgGID, bIsSelect, bIsgroup);
                break;
            }
            }

            DeselectAllPages();

            //if child page is not set(value is 100%)
            //Set scale the same as parent page(only create child page, not active child page)
            if (newPage.EditorScale == 1)
            {
                newPage.EditorScale = activePage.EditorScale;
            }
            newPage.Open();
            EditPages.Add(newPage);
            newPage.IsActive = true;
            newPage.Update();
            return(null);
        }