private async void NiconicoSession_RequireTwoFactorAuth(object sender, Models.NiconicoSessionLoginRequireTwoFactorAuthEventArgs e)
        {
            var deferral    = e.Deferral;
            var currentView = CoreApplication.GetCurrentView();

            if (currentView.IsMain)
            {
                await PageManager.StartNoUIWork("二要素認証を処理中...",
                                                () => DialogService.ShowNiconicoTwoFactorLoginDialog(e.TwoFactorAuthPageUri).AsAsyncAction()
                                                );
            }
            else
            {
                await DialogService.ShowNiconicoTwoFactorLoginDialog(e.TwoFactorAuthPageUri);
            }

            deferral.Complete();

            // ログイン処理が終わるぐらいまで待機して
            await Task.Delay(500);

            // ログインに失敗していた場合はダイアログを再表示
            if (!NiconicoSession.IsLoggedIn && !NiconicoSession.ServiceStatus.IsOutOfService())
            {
                LoginCommand.Execute();
            }
        }
        private async void NiconicoSession_RequireTwoFactorAuth(object sender, Models.NiconicoSessionLoginRequireTwoFactorAuthEventArgs e)
        {
            var deferral    = e.Deferral;
            var currentView = CoreApplication.GetCurrentView();

            if (currentView.IsMain)
            {
                await PageManager.StartNoUIWork("2段階認証を処理しています...",
                                                () => ShowTwoFactorNumberInputDialogAsync(e.HttpRequestMessage.RequestUri, e.Context).AsAsyncAction()
                                                );
            }
            else
            {
                await ShowTwoFactorNumberInputDialogAsync(e.HttpRequestMessage.RequestUri, e.Context);
            }

            deferral.Complete();

            // ログイン処理が終わるぐらいまで待機して
            await Task.Delay(500);

            // ログインに失敗していた場合はダイアログを再表示
            if (!NiconicoSession.IsLoggedIn && !NiconicoSession.ServiceStatus.IsOutOfService())
            {
                LoginCommand.Execute();
            }
        }