Exemplo n.º 1
0
        public TaskViewModel()
        {
            //register this vm with the service
            _dialogService = new DialogWindowService(this);

            TaskButtonAddClick    = new TaskButtonCommand(this.AddItem, this.CanAddItem);
            TaskButtonEditClick   = new TaskButtonCommand(this.EditItem, this.CanEditItem);
            TaskButtonRemoveClick = new TaskButtonCommand(this.RemoveItem, this.CanRemoveItem);

            NewTask = new Models.Task();
            NewTask.PropertyChanged += (s, e) => { TaskButtonAddClick.RaiseCanExecuteChanged(); };

            //Tasks = new ObservableCollection<Models.Task>();

            //load sample tasks
            LoadTasks();
        }
Exemplo n.º 2
0
 public TaskEditViewModel()
 {
     TaskButtonOkClick     = new TaskButtonCommand(this.OkClick, this.CanOKWindow);
     TaskButtonCancelClick = new TaskButtonCommand(this.CancelClick, this.CanCancelWindow);
 }