Beispiel #1
0
        void ExecuteLoadItemsCommand()
        {
            IsBusy = true;

            try
            {
                Items.Clear();
                for (int i = 0; i < 3; i++)
                {
                    Items.Add(new ModelIssue12574 {
                        Id = Guid.NewGuid().ToString(), Text = $"{i} item", Description = "This is an item description."
                    });
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
            finally
            {
                IsBusy = false;
                RemoveAllItemsCommand.ChangeCanExecute();
                RemoveLastItemCommand.ChangeCanExecute();
            }
        }
Beispiel #2
0
 void ExecuteRemoveItemsCommand()
 {
     while (Items.Count > 0)
     {
         Items.Remove(Items.Last());
         Items.Remove(Items.Last());
         Items.Remove(Items.Last());
     }
     RemoveAllItemsCommand.ChangeCanExecute();
     RemoveLastItemCommand.ChangeCanExecute();
 }
Beispiel #3
0
 void ExecuteRemoveLastItemCommand()
 {
     Items.Remove(Items.Last());
     RemoveAllItemsCommand.ChangeCanExecute();
     RemoveLastItemCommand.ChangeCanExecute();
 }