Beispiel #1
0
        /// <remarks> Does not update the JournalOwnershipProperty. </remarks>
        private void SwitchToOwnJournal()
        {
            Debug.Assert(_ownJournalScope == null ^ _journalOwnership == JournalOwnership.OwnsJournal);
            if (_ownJournalScope == null)
            {
                // Entries created for this frame in the parent's journal have to be removed.
                JournalNavigationScope parentJns = GetParentJournal(false/*don't create*/);
                if (parentJns != null)
                {
                    parentJns.Journal.RemoveEntries(_navigationService.GuidId);
                }

                _ownJournalScope = new JournalNavigationScope(this);
                _navigationService.InvalidateJournalNavigationScope();

                // BackStackProperty & ForwardStackProperty should become available immediately if
                // OwnsJournal is set *after* Frame is already loaded.
                // See comment in OnPreApplyTemplate().
                if (IsLoaded)
                {
                    _ownJournalScope.EnsureJournal();
                }

                AddCommandBinding(new CommandBinding(NavigationCommands.BrowseBack, OnGoBack, OnQueryGoBack));
                AddCommandBinding(new CommandBinding(NavigationCommands.BrowseForward, OnGoForward, OnQueryGoForward));
                AddCommandBinding(new CommandBinding(NavigationCommands.NavigateJournal, OnNavigateJournal));
                AddCommandBinding(new CommandBinding(NavigationCommands.Refresh, OnRefresh, OnQueryRefresh));
                AddCommandBinding(new CommandBinding(NavigationCommands.BrowseStop, OnBrowseStop));
            }
            _journalOwnership = JournalOwnership.OwnsJournal;
        }
Beispiel #2
0
        private void Initialize()
        {
            Debug.Assert(_navigationService == null && _JNS == null);

            _navigationService = new NavigationService(this);
            _navigationService.BPReady += new BPReadyEventHandler(OnBPReady);

            _JNS = new JournalNavigationScope(this);

            _fFramelet = false;
        }