/// <summary> /// Updates NavigationState to reflect the Journal state, if the Journal is using NavigationState. /// </summary> /// <param name="journalEntry">JournalEntry used to update the browser location.</param> private void UpdateNavigationState(JournalEntry journalEntry) { if (this.UseNavigationState) { if (this._suppressNavigationEvent == false) { string state = journalEntry.Source == null ? string.Empty : UriParsingHelper.InternalUriToExternalValue(journalEntry.Source); Application.Current.Host.NavigationState = state; if (HtmlPage.IsEnabled) { HtmlPage.Document.SetProperty("title", journalEntry.Name); } } } }
/// <summary> /// Updates NavigationState to reflect the Journal state, if the Journal is using NavigationState. /// </summary> /// <param name="journalEntry">JournalEntry used to update the browser location.</param> private void UpdateNavigationState(JournalEntry journalEntry) { if (this.UseNavigationState) { if (this._suppressNavigationEvent == false) { string state = journalEntry.Source == null ? string.Empty : UriParsingHelper.InternalUriToExternalValue(journalEntry.Source); // Title updates only occur when DOM access is enabled, so check this first. if (HtmlPage.IsEnabled) { // In older versions of IE (6, 7, and 8 in 7 compat mode) we use an // iframe to cause journal updates. But this requires that the title // be set before the navigation for the dropdowns for back/forward // to show the correct titles at the correct places in these lists. // // In newer versions of IE, and in all other supported browsers, the // title should be set after the navigation for correct behavior. if (UsingIFrame()) { HtmlPage.Document.SetProperty("title", journalEntry.Name); Application.Current.Host.NavigationState = state; } else { Application.Current.Host.NavigationState = state; HtmlPage.Document.SetProperty("title", journalEntry.Name); } } else { // We don't have DOM access, so just update NavigationState // without a title update Application.Current.Host.NavigationState = state; } } } }