private void ComponentTemplateVM_PropertyChanged(object sender, PropertyChangedEventArgs e) { if (MineralCostFormula.Last().Minerals.SelectedIndex >= 0 && MineralCostFormula[0].Minerals.SelectedIndex >= 0) { MineralCostFormula.Add(new MineralFormulaVM(ParentVM, _staticData)); MineralCostFormula.Last().PropertyChanged += ComponentTemplateVM_PropertyChanged; } }
public void ClearSelection() { Name = ""; Description = ""; _ID = Guid.NewGuid(); MassFormula = ""; VolumeFormula = ""; HTKFormula = ""; CrewReqFormula = ""; MineralCostFormula.Clear(); MineralCostFormula.Add(new MineralFormulaVM(ParentVM, _staticData)); MineralCostFormula.Last().PropertyChanged += ComponentTemplateVM_PropertyChanged; ResearchCostFormula = ""; CreditCostFormula = ""; BuildPointCostFormula = ""; //MountType.Clear();// = new ObservableDictionary<ComponentMountType, bool?>(); foreach (var item in MountType.ToArray()) { MountType[item.Key] = false; } }