Exemplo n.º 1
0
        public virtual void Navigate(ViewModelBase page, bool cache = true)
        {
            if (page == null)
            {
                return;
            }
            var args = new BeforeNavigateEventArgs()
            {
                Page     = CurrentPage,
                NextPage = page
            };

            BeforeNavigate?.Invoke(this, args);
            if (args.Cancel)
            {
                return;
            }
            if (cache)
            {
                _history.Add(page);
            }
            CurrentPage = page;
            if (_navigationHistory.Count > 200)
            {
                _navigationHistory.RemoveAt(0);
            }
            _navigationHistory.Add(page.GetType().FullName);
            AfterNavigate?.Invoke(this, EventArgs.Empty);
        }
Exemplo n.º 2
0
 private void OnAfterNavigate(object sender, NavigateEventArgs e)
 {
     AfterNavigate?.Invoke(sender, e);
 }
Exemplo n.º 3
0
 protected virtual void OnAfterNavigate(object sender, NavigateEventArgs e)
 {
     AfterNavigate?.Invoke(sender, e);
 }