Пример #1
0
		private void ProcessCloseButton()
		{
			void Complete(ContentDialogButtonClickEventArgs a)
			{
				if (!a.Cancel)
				{
					const ContentDialogResult result = ContentDialogResult.None;

					CloseButtonCommand.ExecuteIfPossible(CloseButtonCommandParameter);

					if (Hide(result))
					{
						_tcs.SetResult(result);
					}
				}
			}

			var args = new ContentDialogButtonClickEventArgs(Complete);
			CloseButtonClick?.Invoke(this, args);

			if (args.Deferral == null)
			{
				Complete(args);
			}
		}
Пример #2
0
        private void ProcessCloseButton()
        {
            void Complete(ContentDialogButtonClickEventArgs a)
            {
                if (!a.Cancel)
                {
                    const ContentDialogResult result = ContentDialogResult.None;

                    CloseButtonCommand.ExecuteIfPossible(CloseButtonCommandParameter);

                    Hide(result);
                }
                else
                {
                    _hiding = false;
                }
            }

            if (_hiding)
            {
                return;
            }
            _hiding = true;

            var args = new ContentDialogButtonClickEventArgs(Complete);

            CloseButtonClick?.Invoke(this, args);

            if (args.Deferral == null)
            {
                Complete(args);
            }
        }
Пример #3
0
 private void OnClose()
 {
     CloseButtonClicked?.Invoke();
     CloseButtonCommand?.Execute(this);
 }