Exemple #1
0
        internal void Close(object parameter)
        {
            var dialogClosingEventArgs = new DialogClosingEventArgs(_session, parameter, DialogClosingEvent);

            _session.IsEnded = true;

            //多种可能关闭Dialog的方式
            OnDialogClosing(dialogClosingEventArgs);
            _attachedDialogClosingEventHandler?.Invoke(this, dialogClosingEventArgs);
            DialogClosingCallback?.Invoke(this, dialogClosingEventArgs);
            _asyncShowClosingEventHandler?.Invoke(this, dialogClosingEventArgs);

            if (!dialogClosingEventArgs.IsCancelled)
            {
                SetCurrentValue(IsOpenProperty, false);
            }
            else
            {
                _session.IsEnded = false;
            }

            _closeDialogExecutionParameter = parameter;
        }
Exemple #2
0
 protected void OnDialogClosing(DialogClosingEventArgs eventArgs)
 {
     RaiseEvent(eventArgs);
 }