Пример #1
0
        public void TransitionWindow(ISimpleWindow to)
        {
            to.SetDataContext(DataContext);
            to.ShowWindow();

            CloseWindow();
            provider.Window = to;
        }
Пример #2
0
        protected override void NavigateWindow(SimpleViewModel navObject, ISimpleWindow newWindow)
        {
            if (navObject is AuthorizedViewModel authVM)
            {
                if (VerifyNavigation(authVM))
                {
                    base.Navigate(navObject);
                    return;
                }

                base.NavigateWindow(service.DefaultNavigation, new LoginWindow());
                return;
            }
            base.NavigateWindow(navObject, newWindow);
        }
Пример #3
0
        /// <summary>
        /// Navigate to a ViewModel with a new window
        /// </summary>
        /// <param name="navObject">ViewModel to navigate to</param>
        /// <param name="newWindow">Window to navigate to</param>
        public void NavigateWithNewWindow(SimpleViewModel navObject, ISimpleWindow newWindow)
        {
            if (Provider == null)
            {
                throw new NullReferenceException("The navigation service does not have a registered 'ISimpleNavigationProvider'");
            }

            var args = new WindowEventArgs(newWindow, Provider.Window);

            Navigate(navObject);

            OnBeforeClosing(this, args);
            Provider.Window.TransitionWindow(newWindow);
            OnAfterClosing(this, args);
        }
Пример #4
0
 public WindowEventArgs(ISimpleWindow windowTo, ISimpleWindow windowFrom = null)
 {
     WindowTo   = windowTo;
     WindowFrom = windowFrom;
 }
Пример #5
0
 protected virtual void NavigateWindow(SimpleViewModel navObject, ISimpleWindow newWindow)
 {
     service.NavigateWithNewWindow(navObject, newWindow);
 }