Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }