예제 #1
0
        private async void SignIn_IsVisibleChanged1(object sender, DependencyPropertyChangedEventArgs e)
        {
            if (signIn.IsVisible)
            {
                signIn.Login.Enable();
                if (Identity.ConfExists())
                {
                    try
                    {
                        signIn.DialogHost.OpenControl();
                        await Identity.RefreshIfRequired();
                    }
                    catch (ApiException exception)
                    {
                        signIn.SetErrorHint(exception);


                        signIn.DialogHost.CurrentSession.Close();
                        return;
                    }

                    signIn.DialogHost.CurrentSession.Close();
                    Hide();
                }
            }
            else
            {
                Show();
                await AddUserNameAndAvatar();
            }
        }
예제 #2
0
        private async void SignIn_OnInitialized(object sender, EventArgs e)
        {
            if (Identity.ConfExists())
            {
                try
                {
                    DialogHost.OpenControl();
                    await Identity.RefreshIfRequired();
                }
                catch (ApiException exception)
                {
                    SetErrorHint(exception);

                    DialogHost.CurrentSession.Close();
                    return;
                }

                DialogHost.CurrentSession.Close();

                var mainWindow = new MainWindow();
                mainWindow.Show();
                Close();
            }
        }