public void Reload() { //DataContextが変更されたタイミングで呼び出される。 //ここで状態を復元 Reload(state); state = null; }
public virtual void Complete(VMState state) { Action action = GetCompleteAction(state); if (action == null) { return; } using (UndoTransaction tx = new UndoTransaction(UndoManager, true)) { action(); } }
protected override void Reload(VMState state) { rows.Clear(); if (compareTable.IsCompareTypeConceptScheme) { ReloadForConceptScheme(); } else if (compareTable.IsCompareTypeConcept) { ReloadForConcept(); } else if (compareTable.IsCompareTypeVariable) { ReloadForVariable(); } }
protected virtual Action GetCompleteAction(VMState state) { return null; }
protected override void Reload(VMState state) { if (state != null) { SelectedBookItem = EDOUtils.FindOrFirst(books, state.State1); } }
public override VMState SaveState() { VMState state = new VMState(); state.State1 = SelectedFundingInfo.Id; return state; }
protected override Action GetCompleteAction(VMState state) { return () => { foreach (SamplingVM sampling in Samplings) { sampling.GenerateMember(); } }; }
public void Complete(VMState state) { int id = (int)state.State1; VMState childState = (VMState)state.State2; List<MenuItemVM> allMenuItems = AllMenuItems; foreach (MenuItemVM menuItem in allMenuItems) { if (menuItem.Id == id) { menuItem.Content.Complete(childState); } } }
public void LoadState(VMState state) { int id = (int)state.State1; VMState childState = (VMState)state.State2; List<MenuItemVM> allMenuItems = AllMenuItems; foreach (MenuItemVM menuItem in allMenuItems) { menuItem.IsSelected = false; if (menuItem.Id == id) { menuItem.IsSelected = true; menuItem.Content.LoadState(childState); } } }
public override VMState SaveState() { if (SelectedConcept == null) { //ありえないかもしれないが一応チェックが必要? return null; } VMState state = new VMState(); state.State1 = SelectedConcept.Id; if (SelectedQuestion != null) { state.State2 = SelectedQuestion.Id; ResponseVM response = SelectedQuestion.Response; state.State3 = response.SelectedIndex; } return state; }
protected override void Reload(VMState state) { UpdateConcepts(); if (state != null) { SelectedConcept = EDOUtils.Find(Concepts, state.State1); if (SelectedConcept != null) { SelectedQuestionItem = EDOUtils.Find(SelectedQuestions, state.State2); if (selectedQuestionItem != null) { SelectedQuestion.Response.SelectedIndex = Convert.ToInt32(state.State3); } } } if (SelectedConcept == null) { SelectedConcept = EDOUtils.GetFirst<ConceptVM>(Concepts); } }
public override VMState SaveState() { VMState state = new VMState(); if (SelectedControlConstructScheme != null) { state.State1 = SelectedControlConstructScheme.Id; } return state; }
protected override void Reload(VMState state) { if (state != null) { SelectedVariableItem = EDOUtils.Find(variables, state.State1); } if (SelectedVariableItem == null) { SelectedVariableItem = EDOUtils.GetFirst<VariableVM>(variables); } }
protected override Action GetCompleteAction(VMState state) { return () => { StudyUnit.CompleteVariables(); }; }
protected virtual void Reload(VMState state) { }
protected override Action GetCompleteAction(VMState state) { return () => { StudyUnit.CompleteDataSets(); }; }
// メイン画面の書く入力フォームに対応したViewModel。 // 親としてEDOUnitVMを継承した、StudyUnitVMか、GroupVMを想定。 public FormVM(EDOUnitVM edoUnit) : base(edoUnit) { state = null; }
public UndoInfo(EDOModel edoModel, VMState state) { this.edoModel = edoModel; this.state = state; }
public void LoadState(VMState state) { //FormVMの場合Reloadで状態を戻すのでここで一旦保存しておく。 this.state = state; }
protected override void Reload(VMState state) { if (state != null) { SelectedCodeScheme = EDOUtils.Find(codeSchemes, state.State1); } if (SelectedCodeScheme == null) { SelectedCodeScheme = EDOUtils.GetFirst(codeSchemes); } }
protected override Action GetCompleteAction(VMState state) { return () => { UpdateModel(); }; }
protected override void Reload(VMState state) { SelectedQuestionGroup = EDOUtils.FindOrFirst(questionGroups, state); }
public override VMState SaveState() { VMState state = new VMState(); state.State1 = SelectedSampling.Id; return state; }
protected override void Reload(VMState state) { if (state != null) { SelectedDataFile = EDOUtils.Find(dataFiles, state.State1); } if (SelectedDataFile == null) { SelectedDataFile = EDOUtils.GetFirst(dataFiles); } }
protected override void Reload(VMState state) { if (state != null) { selectedSamplingItem = EDOUtils.Find(Samplings, state.State1); } if (selectedSamplingItem == null) { selectedSamplingItem = EDOUtils.GetFirst(Samplings); } }
public void Complete(VMState state) { string edoUnitId = (string)state.State1; VMState childState = (VMState)state.State2; foreach (EDOUnitVM edoUnit in edoUnits) { if (edoUnit.Id == edoUnitId) { SelectedItem.Complete(childState); break; } } }
protected override void Reload(VMState state) { if (state != null) { SelectedItem = EDOUtils.Find(fundingInfos, state.State1); } if (SelectedItem == null) { SelectedItem = EDOUtils.GetFirst(fundingInfos); } }
public override VMState SaveState() { VMState state = new VMState(); if (SelectedBook != null) { state.State1 = SelectedBook.Id; } return state; }