예제 #1
0
 // this includes rollback
 void _reset()
 {
     Events.GetEvent <CategoryViewModelEditCanceledEvent>().Publish(this);
     IsEditing = false;
     Committed = true;
     CancelCommand.RaiseCanExecuteChanged();
 }
예제 #2
0
        void ConfigurationPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            switch (e.PropertyName)
            {
            case "HasChanges":
                CommandManager.InvalidateRequerySuggested();
                SaveCommand.RaiseCanExecuteChanged();
                CancelCommand.RaiseCanExecuteChanged();
                ClearErrorsCommand.RaiseCanExecuteChanged();
                if (Configuration.HasChanges)
                {
                    SaveSuccess = false;
                }
                break;

            case "HasError":
                CommandManager.InvalidateRequerySuggested();
                SaveCommand.RaiseCanExecuteChanged();
                CancelCommand.RaiseCanExecuteChanged();
                ClearErrorsCommand.RaiseCanExecuteChanged();
                break;

            default:
                break;
            }
        }
예제 #3
0
        private async void Start()
        {
            try
            {
                CancellationTokenSource = new CancellationTokenSource();

                RunTask = true;
                StartCommand.RaiseCanExecuteChanged();
                CancelCommand.RaiseCanExecuteChanged();

                var tasks = new List <Task>();

                tasks.AddRange(new List <Task>()
                {
                    InitializeProgressBar(ProgressBarOneText, new Progress <int>(p => ProgressBarOneValue     = p), CancellationTokenSource.Token),
                    InitializeProgressBar(ProgressBarTwoText, new Progress <int>(p => ProgressBarTwoValue     = p), CancellationTokenSource.Token),
                    InitializeProgressBar(ProgressBarThreeText, new Progress <int>(p => ProgressBarThreeValue = p), CancellationTokenSource.Token),
                });

                await Task.WhenAll(tasks);
            }
            catch (OperationCanceledException)
            {
            }
            finally
            {
                RunTask = false;
                StartCommand.RaiseCanExecuteChanged();
                CancelCommand.RaiseCanExecuteChanged();
            }
        }
예제 #4
0
 protected override void OnPropertyChanged(string propertyName)
 {
     base.OnPropertyChanged(propertyName);
     if (propertyName == "CanSave")
     {
         SaveCommand.RaiseCanExecuteChanged();
     }
     else if (propertyName == "CanCancel")
     {
         CancelCommand.RaiseCanExecuteChanged();
     }
     else if (propertyName == "CanDelete")
     {
         DeleteCommand.RaiseCanExecuteChanged();
     }
     else if (propertyName == "CanRemove")
     {
         RemoveCommand.RaiseCanExecuteChanged();
     }
     else if (propertyName == "CanAddNew")
     {
         AddCommand.RaiseCanExecuteChanged();
     }
     else if (propertyName == "IsBusy")
     {
         RefreshCommands();
     }
 }
 private void InvalidateCommands()
 {
     SaveCommand.RaiseCanExecuteChanged();
     CancelCommand.RaiseCanExecuteChanged();
     RoleChangedCommand.RaiseCanExecuteChanged();
     GenPersonCodeCommand.RaiseCanExecuteChanged();
 }
 private void ItemPropertyChanged(object sender, PropertyChangedEventArgs e)
 {
     _changeProvided = true;
     Trace.WriteLine("Value of property has changed");
     SaveCommand.RaiseCanExecuteChanged();
     CancelCommand.RaiseCanExecuteChanged();
 }
예제 #7
0
 private void ButtonUpdate()
 {
     AddCommand.RaiseCanExecuteChanged();
     ChangeCommand.RaiseCanExecuteChanged();
     OkCommand.RaiseCanExecuteChanged();
     CancelCommand.RaiseCanExecuteChanged();
     SelectAndChangeCommand.RaiseCanExecuteChanged();
 }
예제 #8
0
 protected virtual void RaiseAllCanExecuteChanged()
 {
     SearchCommand.RaiseCanExecuteChanged();
     AddCommand.RaiseCanExecuteChanged();
     DeleteCommand.RaiseCanExecuteChanged();
     SaveCommand.RaiseCanExecuteChanged();
     CancelCommand.RaiseCanExecuteChanged();
 }
예제 #9
0
 private void OnModelPropertyChanged(object sender, PropertyChangedEventArgs e)
 {
     SearchCommand.RaiseCanExecuteChanged();
     AddCommand.RaiseCanExecuteChanged();
     DeleteCommand.RaiseCanExecuteChanged();
     SaveCommand.RaiseCanExecuteChanged();
     CancelCommand.RaiseCanExecuteChanged();
 }
 public void Done()
 {
     _connectedUasManager.Active.Transport.SendMessage(UasCommands.PreflightCalibration(_connectedUasManager.Active.Uas.SystemId, _connectedUasManager.Active.Uas.ComponentId, 0, 0, 0, 0, 2, 0, 0));
     BeginCommand.RaiseCanExecuteChanged();
     CancelCommand.RaiseCanExecuteChanged();
     DoneCommand.RaiseCanExecuteChanged();
     NextCommand.RaiseCanExecuteChanged();
 }
예제 #11
0
 private void NotifyCommands()
 {
     CancelCommand.RaiseCanExecuteChanged();
     CheckoutCommand.RaiseCanExecuteChanged();
     PrintCommand.RaiseCanExecuteChanged();
     PreviewCommand.RaiseCanExecuteChanged();
     SearchProductCommand.RaiseCanExecuteChanged();
 }
        private void Save()
        {
            _fileService.SaveToFile(Users.ToList());

            _changeProvided = false;
            SaveCommand.RaiseCanExecuteChanged();
            CancelCommand.RaiseCanExecuteChanged();
        }
예제 #13
0
 private void UpdateCommandsCanExecuteStatus()
 {
     CancelCommand.RaiseCanExecuteChanged();
     CommitCommand.RaiseCanExecuteChanged();
     BeginEditCommand.RaiseCanExecuteChanged();
     AddCommand.RaiseCanExecuteChanged();
     DeleteCommand.RaiseCanExecuteChanged();
 }
예제 #14
0
 private void InvalidateCommands()
 {
     SaveCommand.RaiseCanExecuteChanged();
     AddProductCommand.RaiseCanExecuteChanged();
     CancelCommand.RaiseCanExecuteChanged();
     DeleteProductCommand.RaiseCanExecuteChanged();
     FilterCommand.RaiseCanExecuteChanged();
 }
        private void Cancel()
        {
            Loadusers();

            _changeProvided = false;
            SaveCommand.RaiseCanExecuteChanged();
            CancelCommand.RaiseCanExecuteChanged();
        }
예제 #16
0
 private void RefreshCommands()
 {
     SaveCommand.RaiseCanExecuteChanged();
     CancelCommand.RaiseCanExecuteChanged();
     DeleteCommand.RaiseCanExecuteChanged();
     CreateCommand.RaiseCanExecuteChanged();
     RemoveCommand.RaiseCanExecuteChanged();
     AddCommand.RaiseCanExecuteChanged();
 }
예제 #17
0
 void ParentJob_OnTaskState(object sender, TaskStateEventArg e)
 {
     if (e.TaskId.JobTaskId == this.TaskID)
     {
         this.State = e.NewState;
         CancelCommand.RaiseCanExecuteChanged();
         RequeueCommand.RaiseCanExecuteChanged();
     }
 }
예제 #18
0
        protected override void OnChanged()
        {
            base.OnChanged();

            // Refresh commands
            SaveCommand.RaiseCanExecuteChanged();
            SaveAndCloseCommand.RaiseCanExecuteChanged();
            CancelCommand.RaiseCanExecuteChanged();
            DeleteCommand.RaiseCanExecuteChanged();
        }
        private void Remove()
        {
            Users.Remove(SelectedUser);


            _changeProvided = true;

            SaveCommand.RaiseCanExecuteChanged();
            CancelCommand.RaiseCanExecuteChanged();
        }
        private void Add()
        {
            Users.Add(new User());


            _changeProvided = true;

            SaveCommand.RaiseCanExecuteChanged();
            CancelCommand.RaiseCanExecuteChanged();
        }
예제 #21
0
 private async void CancelPressed(object obj)
 {
     await Task.Factory.StartNew(
         () =>
     {
         _isPressed = true;
         CancelCommand.RaiseCanExecuteChanged();
         ActionText = _cancelText;
         _cancelCallback?.Invoke();
     });
 }
 private void InvalidateCommands()
 {
     SaveCommand.RaiseCanExecuteChanged();
     DeleteCommand.RaiseCanExecuteChanged();
     CancelCommand.RaiseCanExecuteChanged();
     PrintCommand.RaiseCanExecuteChanged();
     GetAccountCommand.RaiseCanExecuteChanged();
     EditOrderItemCommand.RaiseCanExecuteChanged();
     DeleteOrderItemCommand.RaiseCanExecuteChanged();
     NewOrderItemCommand.RaiseCanExecuteChanged();
 }
 private void InvalidateCommands()
 {
     DeleteEmployeeCommand.RaiseCanExecuteChanged();
     EditEmployeeCommand.RaiseCanExecuteChanged();
     EditCOACommand.RaiseCanExecuteChanged();
     DeleteCOACommand.RaiseCanExecuteChanged();
     SaveCommand.RaiseCanExecuteChanged();
     CancelCommand.RaiseCanExecuteChanged();
     EditAttributeCommand.RaiseCanExecuteChanged();
     DeleteAttributeCommand.RaiseCanExecuteChanged();
 }
예제 #24
0
 protected void UpdateCrudCommands()
 {
     ExecuteUIThread(() =>
     {
         EditCommand.RaiseCanExecuteChanged();
         SaveCommand.RaiseCanExecuteChanged();
         CancelCommand.RaiseCanExecuteChanged();
         AddCommand.RaiseCanExecuteChanged();
         DeleteCommand.RaiseCanExecuteChanged();
     });
 }
예제 #25
0
        private void Cancel()
        {
            if (CancellationTokenSource != null)
            {
                CancellationTokenSource.Cancel();
            }

            RunTask = false;

            StartCommand.RaiseCanExecuteChanged();
            CancelCommand.RaiseCanExecuteChanged();
        }
예제 #26
0
 public override void AfterItemPermissionsCompleted()
 {
     base.AfterItemPermissionsCompleted();
     NewCommand.RaiseCanExecuteChanged();
     EditCommand.RaiseCanExecuteChanged();
     SaveCommand.RaiseCanExecuteChanged();
     SearchCommand.RaiseCanExecuteChanged();
     DeleteCommand.RaiseCanExecuteChanged();
     PrintCommand.RaiseCanExecuteChanged();
     CancelCommand.RaiseCanExecuteChanged();
     ExportCommand.RaiseCanExecuteChanged();
 }
예제 #27
0
 private void ItemsView_PropertyChanged(object sender, PropertyChangedEventArgs e)
 {
     if (e.PropertyName == nameof(IEditableCollectionView.IsEditingItem) ||
         e.PropertyName == nameof(IEditableCollectionView.IsAddingNew))
     {
         OnPropertyChanged(nameof(IsEditingItem));
         CommitCommand.RaiseCanExecuteChanged();
         CancelCommand.RaiseCanExecuteChanged();
         ReloadCommand.RaiseCanExecuteChanged();
         ToggleEditCommand.RaiseCanExecuteChanged();
     }
 }
예제 #28
0
        /// <summary>
        /// Rétablit l'état inchangé de l'objet en rejetant les modifications
        /// </summary>
        public override void RejectChanges()
        {
            base.RejectChanges();
            CancelEdit();
            BeginEdit();

            // Refresh commands
            SaveCommand.RaiseCanExecuteChanged();
            SaveAndCloseCommand.RaiseCanExecuteChanged();
            CancelCommand.RaiseCanExecuteChanged();
            DeleteCommand.RaiseCanExecuteChanged();
        }
예제 #29
0
 private void ExecuteCancel(object obj)
 {
     foreach (var userRowViewModel in Users)
     {
         if (userRowViewModel.HasChanged)
         {
             userRowViewModel.CancelChanges();
         }
     }
     SaveCommand.RaiseCanExecuteChanged();
     CancelCommand.RaiseCanExecuteChanged();
 }
 private void InvalidateCommands()
 {
     SaveCommand.RaiseCanExecuteChanged();
     DeleteCommand.RaiseCanExecuteChanged();
     CancelCommand.RaiseCanExecuteChanged();
     PrintCommand.RaiseCanExecuteChanged();
     CloseCommand.RaiseCanExecuteChanged();
     GetAccountCommand.RaiseCanExecuteChanged();
     EditInvoiceItemCommand.RaiseCanExecuteChanged();
     DeleteInvoiceItemCommand.RaiseCanExecuteChanged();
     NewInvoiceItemCommand.RaiseCanExecuteChanged();
 }