コード例 #1
0
        private void ActivateEntry(NavigationEntry entry)
        {
            activeEntryIndex = 0;

            for (int i = 0; i < historyList.Count; i++)
            {
                if (historyList[i] == entry)
                {
                    historyList[i].IsActive = true;
                    activeEntryIndex        = i;
                }
                else
                {
                    historyList[i].IsActive = false;
                }
            }

            if (activeEntryIndex > 0)
            {
                CanGoBack = true;
            }
            else
            {
                CanGoBack = false;
            }

            if (activeEntryIndex < historyList.Count - 1)
            {
                CanGoForward = true;
            }
            else
            {
                CanGoForward = false;
            }
        }
コード例 #2
0
        public void ApplySmartPartInfo(object smartPart, ISmartPartInfo smartPartInfo)
        {
            workspace.ApplySmartPartInfo(smartPart, smartPartInfo);

            NavigationEntry entry = FindEntryForSmartPart(smartPart);

            entry.SmartPartInfo = smartPartInfo;
        }
コード例 #3
0
        public void OnShow(UIElement smartPart, SmartPartInfo smartPartInfo)
        {
            NavigationEntry data = new NavigationEntry();

            data.SmartPart     = smartPart;
            data.SmartPartInfo = smartPartInfo;
            internalWorkspaceDataCollection.Add(data);

            Activate(smartPart);
        }
コード例 #4
0
        public void OnClose(UIElement smartPart)
        {
            OnHide(smartPart);

            NavigationEntry dataToRemove = null;

            foreach (NavigationEntry data in internalWorkspaceDataCollection)
            {
                if (data.SmartPart == smartPart)
                {
                    dataToRemove = data;
                    break;
                }
            }

            if (dataToRemove == null)
            {
                internalWorkspaceDataCollection.Remove(dataToRemove);
            }
        }
コード例 #5
0
        private void SmartPartActivatedEventHandler(object sender, WorkspaceEventArgs e)
        {
            NavigationEntry entry = FindEntryForSmartPart(e.SmartPart);

            if (entry == null)
            {
                entry           = new NavigationEntry();
                entry.SmartPart = e.SmartPart;

                historyList.Add(entry);
                navigationEntryCollection.Insert(0, entry);
            }

            ActivateEntry(entry);

            if (SmartPartActivated != null)
            {
                SmartPartActivated(this, e);
            }
        }
コード例 #6
0
        private void SmartPartClosingEventHandler(object sender, WorkspaceCancelEventArgs e)
        {
            NavigationEntry entry = FindEntryForSmartPart(e.SmartPart);

            historyList.Remove(entry);
            navigationEntryCollection.Remove(entry);

            if (historyList.Count > 1)
            {
                Activate(historyList[0].SmartPart);
            }
            else
            {
                if (historyList.Count > 0)
                {
                    ActivateEntry(historyList[0]);
                }
            }

            if (SmartPartClosing != null)
            {
                SmartPartClosing(this, e);
            }
        }