/// <summary> /// Shows toast by specified setting action. /// </summary> /// <param name="settingAction">The setting action.</param> public void Show(Action <ToastSetting> settingAction) { var setting = new ToastSetting(); settingAction(setting); OnShow?.Invoke(setting); }
/// <summary> /// Show the toast with specified setting. /// </summary> /// <param name="setting">The setting of toast message.</param> public void Show(ToastSetting setting) { InvokeAsync(() => { if (setting.Key == Key) { ToastList.Add(new ToastInstance { Id = Guid.NewGuid(), Settings = setting, Timestamp = DateTime.Now }); StateHasChanged(); } }); }