예제 #1
0
 private void EngineFamilyTypeSelectionChanged(
     object sender, SelectionChangedEventArgs e)
 {
     engines.Clear();
     if (e.AddedItems[0] is ViewModelStubAny)
     {
         familyType = null;
         engineType = null;
         return;
     }
     engines.Add(new ViewModelStubAny());
     familyType = ((EngineFamilyTypeViewModel)e.AddedItems[0]).Model;
     foreach (EngineType engineTypeItem in EngineToFamilyMapping.
              GetFamilyMembers(familyType.Value))
     {
         engines.Add(new EngineTypeViewModel(engineTypeItem));
     }
 }
 private void EngineFamilyTypeSelectionChanged(
     object sender, SelectionChangedEventArgs e)
 {
     engines.Clear();
     selectedEngine = null;
     if (e.AddedItems[0] is ViewModelStubAny)
     {
         selectedFamilyType = null;
         YieldCriteriaHasChanged();
         return;
     }
     engines.Add(new ViewModelStubAny());
     selectedFamilyType = e.AddedItems[0] as EngineFamilyTypeViewModel;
     foreach (EngineType engineType in EngineToFamilyMapping.
              GetFamilyMembers(selectedFamilyType.Model))
     {
         engines.Add(new EngineTypeViewModel(engineType));
     }
     YieldCriteriaHasChanged();
 }