コード例 #1
0
 private void EditGameContentDialog_OnClosing(ContentDialog sender, ContentDialogClosingEventArgs args)
 {
     if (!_closeDialog)
     {
         args.Cancel = true;
     }
 }
コード例 #2
0
 private void OnLoginDialogClosing(ContentDialog sender, ContentDialogClosingEventArgs args)
 {
     if (!CanClose)
     {
         args.Cancel = true;
     }
 }
コード例 #3
0
 private async void AudioCaptureDialog_Closing(ContentDialog sender, ContentDialogClosingEventArgs args)
 {
     if (_capture != null)
     {
         try
         {
             await _capture.StopRecordAsync();
         }
         catch { };
         try
         {
             _capture.Dispose();
         }
         catch { };
         _mediaTimelineController.Pause();
         try
         {
             (_player.Source as MediaSource).Dispose();
         }
         catch { };
         _player.Dispose();
         _timer.Stop();
         if (!_proceed)
         {
             await(await ApplicationData.Current.TemporaryFolder.GetFileAsync(_tempFile)).DeleteAsync();
         }
     }
 }
コード例 #4
0
 public void ContentDialog_Closing(ContentDialog sender, ContentDialogClosingEventArgs args)
 {
     if (!canClose)
     {
         args.Cancel = true;
     }
 }
コード例 #5
0
        private void OnClosing(ContentDialog sender, ContentDialogClosingEventArgs args)
        {
            var item = this.Item;

            if (item != null && args.Result == ContentDialogResult.Primary)
            {
                var validationResult = item.Validator.ValidateAll();
                if (validationResult != null && !validationResult.IsValid)
                {
                    foreach (var error in validationResult.ErrorList)
                    {
                        string originalText = this.validationErrors.Text;

                        if (!string.IsNullOrEmpty(originalText))
                        {
                            this.validationErrors.Text += Environment.NewLine;
                        }

                        this.validationErrors.Text += error.ErrorText;
                    }

                    // Show the error and don't allow the dialog to close
                    this.validationErrors.Visibility = Visibility.Visible;
                    args.Cancel = true;
                }
            }
        }
コード例 #6
0
ファイル: ContentDialogEx.cs プロジェクト: rrsc/uwp
 protected void OnClosing(ContentDialog sender, ContentDialogClosingEventArgs args)
 {
     if (!this.ViewModel.CanClose)
     {
         args.Cancel = true;
     }
 }
コード例 #7
0
 private void MyContentDialog_Closing(ContentDialog sender, ContentDialogClosingEventArgs args)
 {
     if (this.rpDownload != null)
     {
         args.Cancel = true;
     }
 }
コード例 #8
0
        private void ContentDialog_Closing(ContentDialog sender, ContentDialogClosingEventArgs args)
        {
            // If result is secondary, we want to close anyway
            if (args.Result == ContentDialogResult.Secondary)
            {
                doNotClose = false;
            }
            else
            {
                // Don't really like this here but...
                if (resultsListView.SelectedItem != null)
                {
                    // only including model to cast
                    StringWrapper wrapper = resultsListView.SelectedItem as StringWrapper;
                    if (!string.IsNullOrEmpty(wrapper.StringContent))
                    {
                        args.Cancel = false;
                    }
                }
            }

            if (doNotClose)
            {
                args.Cancel = true;
            }
        }
コード例 #9
0
 private void KeyEntryDialog_Closing(ContentDialog sender, ContentDialogClosingEventArgs args)
 {
     if (!CanClose)
     {
         args.Cancel = true;
     }
 }
コード例 #10
0
ファイル: CustomDialog.xaml.cs プロジェクト: mkoutlook/uwp
            void SignInContentDialog_Closing(ContentDialog sender, ContentDialogClosingEventArgs args)
            {
                // If sign in was successful, save or clear the user name based on the user choice.
                if (this.Result == SignInResult.SignInOK)
                {
                    if (saveUserNameCheckBox.IsChecked == true)
                    {
                        SaveUserName();
                    }
                    else
                    {
                        ClearUserName();
                    }
                }

                // If the user entered a name and checked or cleared the 'save user name' checkbox, then clicked the back arrow,
                // confirm if it was their intention to save or clear the user name without signing in. 
                if (this.Result == SignInResult.Nothing && !string.IsNullOrEmpty(userNameTextBox.Text))
                {
                    if (saveUserNameCheckBox.IsChecked == false)
                    {
                        args.Cancel = true;
                        FlyoutBase.SetAttachedFlyout(this, (FlyoutBase)this.Resources["DiscardNameFlyout"]);
                        FlyoutBase.ShowAttachedFlyout(this);
                    }
                    else if (saveUserNameCheckBox.IsChecked == true && !string.IsNullOrEmpty(userNameTextBox.Text))
                    {
                        args.Cancel = true;
                        FlyoutBase.SetAttachedFlyout(this, (FlyoutBase)this.Resources["SaveNameFlyout"]);
                        FlyoutBase.ShowAttachedFlyout(this);
                    }
                }
            }
コード例 #11
0
 private void ContentDialog_Closing(ContentDialog sender, ContentDialogClosingEventArgs args)
 {
     if (!isExit && aThreadWaiting)
     {
         args.Cancel = true;
     }
 }
コード例 #12
0
 private void ContentDialog_Closing(ContentDialog sender, ContentDialogClosingEventArgs args)
 {
     if (!IsExit)
     {
         args.Cancel = true;
     }
 }
コード例 #13
0
 void ContentDialog_Closing(ContentDialog sender, ContentDialogClosingEventArgs args)
 {
     if (!viewModel.IsLoading)
     {
         //args.Cancel = true;
     }
 }
コード例 #14
0
 /// <summary>
 /// Prevents closing of the dialog which is the default action by a dialog when any of its stock buttons
 /// are clicked, we will handle closing manually by calling this.Hide().
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="args"></param>
 private void UpdateDialog_Closing(ContentDialog sender, ContentDialogClosingEventArgs args)
 {
     if (ProgressRingUpdate.IsActive)
     {
         args.Cancel = true;
     }
 }
コード例 #15
0
 private void ContentDialog_Closing(ContentDialog sender, ContentDialogClosingEventArgs args)
 {
     if (args.Result == ContentDialogResult.Primary && !IsPrimaryButtonEnabled)
     {
         args.Cancel = true;
     }
 }
コード例 #16
0
 private void SingleVideoDialog_Closing(ContentDialog sender, ContentDialogClosingEventArgs args)
 {
     if (!needToClose)
     {
         args.Cancel = true;
     }
 }
コード例 #17
0
 private void ContentDialog_Closing(ContentDialog sender, ContentDialogClosingEventArgs args)
 {
     if (_blockClose)
     {
         args.Cancel = true;
     }
 }
コード例 #18
0
 private void DatasetImportDialog_Closing(ContentDialog sender, ContentDialogClosingEventArgs args)
 {
     if (!finishImport)
     {
         args.Cancel = true;
     }
 }
コード例 #19
0
ファイル: Page2.xaml.cs プロジェクト: forehalo/UWP-dev
        private void OnDialogClosing(ContentDialog sender, ContentDialogClosingEventArgs args)
        {
            bool isChecked = true;

            if (username.Text == "")
            {
                msg.Text = "请输入用户名。";
                isChecked = false;
            }
            if (pwd.Password == "" || pwd2.Password == "")
            {
                msg.Text = "请输入密码。";
                isChecked = false;
            }
            if (pwd.Password != pwd2.Password)
            {
                msg.Text = "两次输入的密码不一致。";
                isChecked = false;
            }

            if(args.Result == ContentDialogResult.Primary)
            {
                args.Cancel = !isChecked;
            }
        }
コード例 #20
0
 private async void ContentDialog_Closing(ContentDialog sender, ContentDialogClosingEventArgs args)
 {
     if (!CanClose)
     {
         args.Cancel = true;
     }
 }
コード例 #21
0
        private async void ContentDialog_Closing(ContentDialog sender, ContentDialogClosingEventArgs args)
        {
            switch (args.Result)
            {
            case ContentDialogResult.None:
            case ContentDialogResult.Primary:
                if (this.pb_Loading.IsIndeterminate)
                {
                    await logOnAsync(args);
                }
                else
                {
                    if (args.Result == ContentDialogResult.None && Client.Current.NeedLogOn)
                    {
                        args.Cancel = true;
                    }
                }
                break;

            case ContentDialogResult.Secondary:
                if (Client.Current.NeedLogOn)
                {
                    Application.Current.Exit();
                }
                break;
            }
        }
コード例 #22
0
 private void CreateCategoryDialog_Closing(ContentDialog sender, ContentDialogClosingEventArgs args)
 {
     if (!_canClose)
     {
         args.Cancel = true;
     }
 }
コード例 #23
0
 private void SampleDialog_Closing(ContentDialog sender, ContentDialogClosingEventArgs args)
 {
     if (isEscape)
     {
         args.Cancel = true;
     }
 }
コード例 #24
0
        void SignInContentDialog_Closing(ContentDialog sender, ContentDialogClosingEventArgs args)
        {
            // If sign in was successful, save or clear the user name based on the user choice.


            // If the user entered a name and checked or cleared the 'save user name' checkbox, then clicked the back arrow,
            // confirm if it was their intention to save or clear the user name without signing in.
        }
コード例 #25
0
        private void OnClosing(ContentDialog sender, ContentDialogClosingEventArgs args)
        {
            _handler.UnloadVisibleItems();

            _zoomer.Opening      = null;
            _zoomer.Closing      = null;
            _zoomer.DownloadFile = null;
        }
コード例 #26
0
 void SettingsDialog_Closing(ContentDialog sender, ContentDialogClosingEventArgs args)
 {
     // If sign in was successful, save or clear the user name based on the user choice.
     if (this.Result == ContentDialogResult.Primary)
     {
         Windows.Storage.ApplicationData.Current.LocalSettings.Values["ipAddress"] = ipAddress.Text;
     }
 }
 private void ContentDialog_Closing(ContentDialog sender, ContentDialogClosingEventArgs args)
 {
     // ignore Close events except Secondary button
     if (args.Result != ContentDialogResult.Secondary)
     {
         args.Cancel = true;
     }
 }
コード例 #28
0
 private void OnFilePickerClosing(ContentDialog sender, ContentDialogClosingEventArgs args)
 {
     if ((FileListingGrid.Visibility == Visibility.Collapsed) &&
         (args.Result == ContentDialogResult.None || _newFolderMode))
     {
         args.Cancel = true;
         return;
     }
 }
コード例 #29
0
        private void ImmersiveView_OnClosing(ContentDialog sender, ContentDialogClosingEventArgs args)
        {
            var videoView = ContentControl.ContentTemplateRoot as AutoVideoControl;

            if (videoView == null)
            {
                return;
            }
            videoView.MediaPlayer.Pause();
        }
コード例 #30
0
ファイル: AddNewGamePage.xaml.cs プロジェクト: RemSoftDev/GMP
        private void Dialog_Closing(ContentDialog sender, ContentDialogClosingEventArgs args)
        {
            var dialog = sender as CroppImageContentDialog;

            if (dialog?.DialogResult == DialogResultEnum.Cancel)
            {
                args.Cancel = true;
                // Handle back press here instead of closing.
            }
        }
コード例 #31
0
 private void BluetoothFileTransfer_Closing(ContentDialog sender, ContentDialogClosingEventArgs args)
 {
     ObexClient.DataTransferFailed     -= ObexClient_DataTransferFailed;
     ObexClient.DataTransferProgressed -= ObexClient_DataTransferProgressed;
     ObexClient.DataTransferSucceeded  -= ObexClient_DataTransferSucceeded;
     ObexClient.ConnectionFailed       -= ObexClient_ConnectionFailed;
     ObexClient.Aborted         -= ObexClient_Aborted;
     ObexClient.Disconnected    -= ObexClient_Disconnected;
     ObexClient.DeviceConnected -= ObexClient_DeviceConnected;
 }
コード例 #32
0
 private void ContentDialog_Closing(ContentDialog sender, ContentDialogClosingEventArgs args)
 {
     if (closing)
     {
         ViewModel.ConfirmSettingsCommand.Execute(null);
     }
     else
     {
         args.Cancel = true;
     }
 }
コード例 #33
0
 private void ProgressDialog_Closing(ContentDialog sender, ContentDialogClosingEventArgs args) {
     args.Cancel = !Cancelable;
 }
コード例 #34
0
 private void ContentDialog_Closing(ContentDialog sender, ContentDialogClosingEventArgs args)
 {
     if (!IsExit)
         args.Cancel = true;
 }
コード例 #35
0
 private void ContentDialog_Closing(ContentDialog sender, ContentDialogClosingEventArgs args)
 {
     if (!isExit && aThreadWaiting)
         args.Cancel = true;
 }