Exemplo n.º 1
0
        public ProjectNotificationViewModel()
        {
            _settings = DI.ClientAppSettings();


            CloseWindowCommand = new RelayCommand(async() =>
            {
                // Animate window closing
                await AnimateOut(TimeSpan.FromSeconds(0.2), (sender, e) =>
                {
                    // After animation finishes, actually close the window
                    _window.Close();
                });
            });
        }
Exemplo n.º 2
0
        protected async override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);


            // Application setup stuff, DI build and such
            await ApplicationSetupAsync();


            DI.Logger().Log("DI setup was completed succesfully", LogLevel.Informative);

            var settings = DI.ClientAppSettings();

            // If user requested to automatically login
            if (settings.RememberMe == true)
            {
                DI.Logger().Log("Logging in using auto sign-in", LogLevel.Informative);

#if DEBUG == TRUE
                // Wait for server to spin up
                await Task.Delay(3000);
#endif

                await LoginAsync(settings);
            }
            ;


            DI.Logger().Log("Initializing MainWindow", LogLevel.Informative);

            // Setup MainWindow
            (Current.MainWindow = new MainWindow(DI.GetService <MainWindowViewModel>()))
            // Show window
            .Show();


            DI.Logger().Log("MainWindow initialization complete", LogLevel.Informative);
        }