public ToDoListControlViewModel() { //初期データ取得 //GridItem = toDoList.GetUserList().Result; var list = new List <TodoDetailData>() { new TodoDetailData() { UserId = 0 , DataId = 0 } }; GridItem = list; //コマンド生成 this.GetMainListCommand = new DelegateCommand(() => { GetUserDataList(); }); this.AddCommand = new DelegateCommand(() => { var baseData = GridItem.FirstOrDefault(); int userId = baseData?.UserId ?? 0; int dataId = baseData?.DataId + 1 ?? 0; var data = new TodoDetailData() { UserId = userId , DataId = dataId }; var result = toDoList.Post(data, GridItem).Result; ToDetail(result); }); this.UpdCommand = new DelegateCommand(() => { this.NotificationRequest.Raise(new Notification { Title = "Alert", Content = "未実装です" }); }); this.DelCommand = new DelegateCommand(() => { this.NotificationRequest.Raise(new Notification { Title = "Alert", Content = "未実装です" }); }); this.DetailCommand = new DelegateCommand(() => { ToDetail(SelectedItem); }); }