/// <summary> /// Occurs when the browser has navigated (usually due to the user hitting Back or Forward in the browser's UI). /// </summary> /// <param name="sender">Event sender.</param> /// <param name="eventArgs">Empty event args.</param> private void Browser_Navigated(object sender, EventArgs eventArgs) { if (this.UseNavigationState) { this.AddHistoryPointIfDifferent(UriParsingHelper.InternalUriFromExternalValue(Application.Current.Host.NavigationState)); } }
internal bool CheckForDeeplinks() { if (this.UseNavigationState) { string currentState = UriParsingHelper.InternalUriFromExternalValue(Application.Current.Host.NavigationState); if (!String.IsNullOrEmpty(currentState)) { this.AddHistoryPointIfDifferent(currentState); return(true); } } return(false); }
/// <summary> /// Conditionally adds a new history point if the new state information differs from the current journal entry Uri value. /// </summary> /// <param name="newState">An updated state value to examine.</param> private void AddHistoryPointIfDifferent(string newState) { // Check if different from our current state string currentState = String.Empty; if (this.CurrentEntry != null && this.CurrentEntry.Source != null) { currentState = UriParsingHelper.InternalUriFromExternalValue(this.CurrentEntry.Source.OriginalString); } if (string.Equals(newState, currentState, StringComparison.Ordinal) == false) { this._suppressNavigationEvent = true; this.AddHistoryPoint(new JournalEntry(string.Empty, new Uri(newState, UriKind.RelativeOrAbsolute))); this._suppressNavigationEvent = false; } }