コード例 #1
0
ファイル: TaskViewModel.cs プロジェクト: neiln/TaskManager
        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();
        }
コード例 #2
0
 public TaskEditViewModel()
 {
     TaskButtonOkClick     = new TaskButtonCommand(this.OkClick, this.CanOKWindow);
     TaskButtonCancelClick = new TaskButtonCommand(this.CancelClick, this.CanCancelWindow);
 }