//public void AskToDeleteCurrent(string message, Action deleteAction, string caption = "Confirm to Delete") // => Alert public void SetItems(IEnumerable <T> items) { this.Clear(); foreach (var item in items) { this.Add(item); } ItemsReplaced?.Invoke(this, EventArgs.Empty); }
//public void AskToDeleteCurrent(string message, Action deleteAction, string caption = "Confirm to Delete") // => Alert public void SetItems(IEnumerable <T> items) { if (IsReplacingItems) { return; } IsReplacingItems = true; IgnoreUIErrors(() => this.Clear()); if (items != null) { foreach (var item in items) { IgnoreUIErrors(() => this.Add(item)); } } IgnoreUIErrors(() => ItemsReplaced?.Invoke(this, EventArgs.Empty)); IsReplacingItems = false; }