internal async Task DismissInstance(DialogReference dialog, DialogResult result)
 {
     if (dialog != null)
     {
         dialog.Dismiss(result);
         Dialogs.Remove(dialog);
         await InvokeAsync(StateHasChanged);
     }
 }
        private async void CancelDialogs(object sender, LocationChangedEventArgs e)
        {
            foreach (var DialogReference in Dialogs.ToList())
            {
                DialogReference.Dismiss(DialogResult.Cancel());
            }

            Dialogs.Clear();
            await InvokeAsync(StateHasChanged);
        }
 private void DismissInstance(DialogReference dialog, DialogResult result)
 {
     dialog.Dismiss(result);
     _dialogs.Remove(dialog);
     StateHasChanged();
 }