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(); }
public TaskEditViewModel() { TaskButtonOkClick = new TaskButtonCommand(this.OkClick, this.CanOKWindow); TaskButtonCancelClick = new TaskButtonCommand(this.CancelClick, this.CanCancelWindow); }