Exentials.MdcBlazor.Tools by Gambarotto Damiano

<PackageReference Include="Exentials.MdcBlazor.Tools" Version="0.7.8-alpha" />

 SnackbarService

public class SnackbarService
using System; using System.Collections.Concurrent; using System.Runtime.CompilerServices; using System.Threading.Tasks; namespace Exentials.MdcBlazor { public class SnackbarService { private ConcurrentQueue<SnackbarOptions> _snacks; private bool _waitDismiss; public event Func<ISnackbarOptions, ValueTask> ShowRequested; public SnackbarService() { _snacks = new ConcurrentQueue<SnackbarOptions>(); } public ValueTask Send(string label) { return Send(new SnackbarOptions { Label = label }); } public ValueTask Send(SnackbarOptions options) { _snacks.Enqueue(options); return InvokeSend(); } public ValueTask NotifyClose(string reason) { _waitDismiss = false; return InvokeSend(); } [AsyncStateMachine(typeof(<InvokeSend>d__9))] public ValueTask InvokeSend() { <InvokeSend>d__9 stateMachine = default(<InvokeSend>d__9); stateMachine.<>t__builder = AsyncValueTaskMethodBuilder.Create(); stateMachine.<>4__this = this; stateMachine.<>1__state = -1; stateMachine.<>t__builder.Start(ref stateMachine); return stateMachine.<>t__builder.Task; } } }