private void TurbinesList_SelectionChanged(object sender, SelectionChangedEventArgs e) { var tab = (TabControl)sender; var item = (VTurbineArrayInstance)tab.SelectedItem; if (item == null) { return; } if (item.ShowInstance == Visibility.Collapsed) { var turbine = new VTurbineArrayInstance() { PropName = "turbine" + viewPropArray.Turbines.Count, TurbineType = "none", TypesCopy = turbineNameArray // TODO }; viewPropArray.Turbines.Insert(viewPropArray.Turbines.Count - 1, turbine); TurbinesList.SelectedItem = turbine; viewPropArray.AcceptChanges(); } }
private void TurbinesList_SelectionChanged(object sender, SelectionChangedEventArgs e) { var tab = (TabControl) sender; var item = (VTurbineArrayInstance) tab.SelectedItem; if (item == null) return; if (item.ShowInstance == Visibility.Collapsed) { var turbine = new VTurbineArrayInstance() { PropName = "turbine" + viewPropArray.Turbines.Count, TurbineType = "none", TypesCopy = turbineNameArray // TODO }; viewPropArray.Turbines.Insert(viewPropArray.Turbines.Count - 1, turbine); TurbinesList.SelectedItem = turbine; viewPropArray.AcceptChanges(); } }