public void Remove(string par1) { var item = Toasts.Where(x => x.Titel == par1).FirstOrDefault(); Toasts.Remove(item); OnToastsUpdated?.Invoke(); }
public void Remove(Toast toast) { toast.OnClose -= Remove; Toasts.Remove(toast); OnToastsUpdated?.Invoke(); toast.Dispose(); }
private void OnShowToast(ShowToastMessage showToastMessage) { var toast = new ToastViewModel(showToastMessage, _chatDocumentCreator(), _bus, _activator); Toasts.Add(toast); toast.Closed.SubscribeOnceUI(_ => { Toasts.Remove(toast); toast.Dispose(); }); }