コード例 #1
0
        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();
            }
        }
コード例 #2
0
        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();
            }
        }