Exemplo n.º 1
0
 /// <inheritdoc />
 public sealed override void DismissAllowingStateLoss()
 {
     DialogWillHide?.Invoke(this, EventArgs.Empty);
     CancelResult();
     base.DismissAllowingStateLoss();
     OnHidden();
     DialogHidden?.Invoke(this, EventArgs.Empty);
     DialogsManager.CurrentlyDisplayedDialog = null;
 }
Exemplo n.º 2
0
 internal void HideInternal(bool fromHidden)
 {
     DialogWillHide?.Invoke(this, EventArgs.Empty);
     CancelResult();
     if (!fromHidden)
     {
         base.Hide();
     }
     OnHidden();
     DialogHidden?.Invoke(this, EventArgs.Empty);
     DialogsManager.CurrentlyDisplayedDialog = null;
 }
Exemplo n.º 3
0
        /// <summary>
        /// Hides the dialog asynchronously. The task will be completed once the dialog has fully disappeared.
        /// </summary>
        public async Task HideAsync()
        {
            _hideSemaphore = new SemaphoreSlim(0);
            DialogWillHide?.Invoke(this, EventArgs.Empty);

            if (AnimationConfig.HideAnimationType == DialogAnimationType.CustomBlurFade)
            {
                await Task.Delay((int)(AnimationConfig.HideCustomAnimationDurationSeconds * 1000));
            }

            Hide();
            await _hideSemaphore.WaitAsync();
        }