Beispiel #1
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            ContentWindow contentWindow = new ContentWindow();

            NavigationModel navigationModel = new NavigationModel(contentWindow);

            NavigationManager.Instance.Initialize(navigationModel);
            contentWindow.Show();
            navigationModel.Navigate(ModesEnum.Main);

            Current.MainWindow.Closing += (s, a) =>
            {
                if (MessageBox.Show("Вийти?", "", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.Yes)
                {
                    StationManager.InvokeStopThreads();
                    Environment.Exit(0);
                }
                else
                {
                    a.Cancel = true;
                }
            };
        }
Beispiel #2
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            ContentWindow   contentWindow   = new ContentWindow();
            NavigationModel navigationModel = new NavigationModel(contentWindow);

            NavigationManager.Instance.Initialize(navigationModel);
            contentWindow.Show();
            if (AUTHORIZATION_STUB != null)
            {
                var authResp = HotelApiClient.GetInstance().Login(AUTHORIZATION_STUB.Login, AUTHORIZATION_STUB.Password);
                if (authResp != null)
                {
                    var userRole = authResp.User.Role;
                    Storage.Instance.ChangeUser(new User(LoginModel.RightsDictionary[userRole]));

                    NavigationManager.Instance.Navigate(ModesEnum.Main);
                }
            }
            else
            {
                navigationModel.Navigate(ModesEnum.Login);
            }
        }
Beispiel #3
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);
            ContentWindow contentWindow = new ContentWindow();

            contentWindow.Show();
            contentWindow.ContentControl.Content = new MainView();
        }
Beispiel #4
0
 /// <summary>
 /// Opens a new window and display the provided content.
 /// </summary>
 /// <param name="content">The content to display.</param>
 /// <param name="options">The options used to configure the host <see cref="UnityEditor.EditorWindow"/></param>
 /// <exception cref="ArgumentNullException">The content cannot be <see langword="null"/>.</exception>
 /// <typeparam name="T">The typeof the content. Must be default constructable.</typeparam>
 public static void ShowInWindow <T>(T content, ContentWindowParameters options)
     where T : ContentProvider, new()
 {
     if (EqualityComparer <T> .Default.Equals(content, default))
     {
         throw new ArgumentNullException(nameof(content));
     }
     ContentWindow.Show(content, options);
 }
Beispiel #5
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);
            ContentWindow   contentWindow   = new ContentWindow();
            NavigationModel navigationModel = new NavigationModel(contentWindow);

            NavigationManager.Instance.Initialize(navigationModel);
            contentWindow.Show();
            navigationModel.Navigate(ModesEnum.Calendar);
        }
Beispiel #6
0
 protected override void OnStartup(StartupEventArgs e)
 {
     base.OnStartup(e);
     Storage storage = new Storage();
     ContentWindow contentWindow = new ContentWindow();
     NavigationModel navigationModel = new NavigationModel(contentWindow, storage);
     NavigationManager.Instance.Initialize(navigationModel);
     contentWindow.Show();
     navigationModel.Navigate();
 }
Beispiel #7
0
 /// <summary>
 /// Opens a new window and display the provided <see cref="UnityEngine.Object"/>.
 /// </summary>
 /// <param name="content">The <see cref="UnityEngine.Object"/> to display.</param>
 /// <param name="options">The options used to configure the host <see cref="UnityEditor.EditorWindow"/></param>
 /// <exception cref="ArgumentNullException">The content cannot be <see langword="null"/>.</exception>
 public static void ShowInWindow(UnityEngine.Object content, ContentWindowParameters options)
 {
     if (null == content || !content)
     {
         throw new ArgumentNullException(nameof(content));
     }
     ContentWindow.Show(new UnityObjectContentProvider {
         Object = content
     }, options);
 }
Beispiel #8
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);
            UserInfoModel   userInfoModel   = new UserInfoModel();
            ContentWindow   contentWindow   = new ContentWindow();
            NavigationModel navigationModel = new NavigationModel(contentWindow, userInfoModel);

            NavigationManager.Instance.Initialize(navigationModel);
            contentWindow.Show();
            navigationModel.Navigate(ViewsEnum.Start);
        }
 public void PopoutContentWindow(ILocaleKeyEntry entry)
 {
     if (ContentWindow.ViewModel == null)
     {
         ContentWindow.ViewModel = new LocaleContentWindowViewModel()
         {
             ContentFontSize  = ViewModel.ContentFontSize,
             ContentLightMode = ViewModel.ContentLightMode,
             Entry            = entry,
             SelectedColor    = ViewModel.SelectedColor
         };
     }
     if (!ContentWindow.IsVisible)
     {
         ContentWindow.Activate();
         ContentWindow.Show();
         ContentWindow.Owner = this;
     }
 }