Exemplo n.º 1
0
        private Task OnSnackbarClosed(string key, SnackbarCloseReason closeReason)
        {
            var info = snackbarInfos.FirstOrDefault(x => x.Key == key);

            if (info != null)
            {
                snackbarInfos.Remove(info);
            }

            StateHasChanged();

            return(Closed.InvokeAsync(new SnackbarClosedEventArgs(key, closeReason)));
        }
Exemplo n.º 2
0
        private void Hide(SnackbarCloseReason closeReason)
        {
            if (!Visible)
            {
                return;
            }

            this.closeReason = closeReason;

            Visible = false;

            // finally reset close reason so it doesn't interfere with internal closing by Visible property
            this.closeReason = SnackbarCloseReason.None;

            StateHasChanged();
        }
Exemplo n.º 3
0
 public SnackbarClosedEventArgs(string key, SnackbarCloseReason closeReason)
 {
     Key         = key;
     CloseReason = closeReason;
 }