Exemple #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);
        }
Exemple #2
0
        public void BeforeNavigate2(
            object pDisp,
            ref object URL,
            ref object Flags,
            ref object TargetFrameName,
            ref object PostData,
            ref object Headers,
            ref bool Cancel)
        {
            var args = new BeforeNavigateCancelEventArgs {
                Url = URL.ToString(),
            };

            BeforeNavigate?.Invoke(this, args);
            Cancel = args.Cancel;
        }
Exemple #3
0
 private void OnBeforeNavigate(object sender, NavigateEventArgs e)
 {
     BeforeNavigate?.Invoke(sender, e);
 }
 protected virtual void OnBeforeNavigate(object sender, NavigateEventArgs e)
 {
     BeforeNavigate?.Invoke(sender, e);
 }
Exemple #5
0
#pragma warning restore 618

        protected virtual void OnBeforeNavigate(WebBrowserBeforeNavigateEventArgs e)
        {
            BeforeNavigate?.Invoke(this, e);
        }