Exemplo n.º 1
0
        //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);
        }
Exemplo n.º 2
0
        //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;
        }