Esempio n. 1
0
        private void DeleteItemCommandExecute()
        {
            DeleteItemRequest request = new DeleteItemRequest {
                Item = SelectedItem
            };

            DeleteItemRequest.Raise(request, returned =>
            {
                if (!request.Confirmed)
                {
                    return;
                }
                Items.Remove(SelectedItem);
            });

            AddItemCommand.RaiseCanExecuteChanged();
        }
Esempio n. 2
0
 void UpdateReduxState(object sender, StateChangedEventArgs <RootState> e)
 {
     isUpdatingState = true;
     try
     {
         state       = e.State;
         AllChecked  = e.State.AllChecked;
         NewItemText = e.State.NewItemText;
         int itemsLeft = e.State.Items.Count(i => !i.IsChecked);
         ItemsLeftInfo = $"{itemsLeft} item{(itemsLeft != 1 ? "s" : "")} left";
         ReduxMerger.MergeList <int, TodoItem, TodoItemViewModel>(e.State.FilteredItems, Items, i => todoItemViewModelFactory(i));
         Filter = e.State.Filter;
         AddItemCommand.RaiseCanExecuteChanged();
         RemoveCompletedCommand.RaiseCanExecuteChanged();
         SetFilterCommand.RaiseCanExecuteChanged();
     }
     finally
     {
         isUpdatingState = false;
     }
 }
Esempio n. 3
0
        private void RaiseCanExecuteChanged()
        {
            //Item
            AddItemCommand.RaiseCanExecuteChanged();
            AddVersionCommand.RaiseCanExecuteChanged();
            DeleteItemCommand.RaiseCanExecuteChanged();
            SortItemDownCommand.RaiseCanExecuteChanged();
            SortItemUpCommand.RaiseCanExecuteChanged();

            //Property
            AddItemPropertyCommand.RaiseCanExecuteChanged();
            DeleteItemPropertyCommand.RaiseCanExecuteChanged();
            SortItemPropertyDownCommand.RaiseCanExecuteChanged();
            SortItemPropertyUpCommand.RaiseCanExecuteChanged();

            //DirectHop
            AddDirectHopCommand.RaiseCanExecuteChanged();
            DeleteDirectHopCommand.RaiseCanExecuteChanged();
            SortDirectHopDownCommand.RaiseCanExecuteChanged();
            SortDirectHopUpCommand.RaiseCanExecuteChanged();
        }