Exemplo n.º 1
0
        private async Task <bool> AcceptLoginAsync()
        {
            IsBusy = true;

            var request = new LoginRequest(LoginName, LoginPassowd);

            var response = await _loginRepository.LoginAsync(request).ConfigureAwait(true);

            if (response.IsSuccesfull)
            {
                SnackbarViewModel.Disposed = true;

                await Ioc.AddApplicationCacheAsync(serverSide : true);

                Ioc.ConfigureServerServices(response.Value);

                var mainWindowViewModel = new MainWindowViewModel(online: true);
                await ShowMainWindowDialog.Handle(mainWindowViewModel);

                return(true);
            }

            var message = _loginStatusConverter.Convert(response.Status);
            await SnackbarViewModel.QueueMessage.Execute(message);

            IsBusy = false;

            return(false);
        }
Exemplo n.º 2
0
        private async Task ContinueLocalAsync()
        {
            await Ioc.AddApplicationCacheAsync();

            Ioc.ConfigureLocalServices();

            var mainWindowViewModel = new MainWindowViewModel(online: false);
            await ShowMainWindowDialog.Handle(mainWindowViewModel);
        }