public void AddNewEntry(NavigationEntry navigationEntry) { if (navigationEntry.Current) { // If this is the current one, remove the current flag from all others foreach (var h in HistoryStack) { h.Current = false; } } HistoryStack.Push(navigationEntry); }
public void Navigate(Uri address) { // Reset all entries to not current foreach (var h in HistoryStack) { h.Current = false; } var newNavigationEntry = new NavigationEntry() { Kind = NavigationPageType.Web, WebUri = address, VisitedAt = DateTime.Now, Current = true }; HistoryStack.Push(newNavigationEntry); CanGoBackChanged?.Invoke(true); CanGoForwardChanged?.Invoke(false); NavigationRequested?.Invoke(newNavigationEntry); }
public void Navigate(Type pageType, object param) { // Reset all entries to not current foreach (var h in HistoryStack) { h.Current = false; } var newNavigationEntry = new NavigationEntry() { Kind = NavigationPageType.Native, NativePageType = pageType, NativePageParam = param, VisitedAt = DateTime.Now, Current = true }; HistoryStack.Push(newNavigationEntry); CanGoBackChanged?.Invoke(true); CanGoForwardChanged?.Invoke(false); NavigationRequested?.Invoke(newNavigationEntry); }