private void CityComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { baseParams.CitySelectedIndex = CityComboBox.SelectedIndex; if (IsRunning) { switch (baseParams.CityClimate) { case CityClimateType.NorthClimate: baseParams.ElectricityProductionFactor = 0.8115; break; case CityClimateType.MiddleClimate: baseParams.ElectricityProductionFactor = 0.7495; break; case CityClimateType.SouthClimate: baseParams.ElectricityProductionFactor = 0.6323; break; default: Console.WriteLine("error occurred"); return; } MaintenanceParams maintenanceParams = Parameter.Maintenance; maintenanceParams.Refresh(); (MainWindow.DemoInstance as Demo).RefreshComputation(); } ElectricityCO2FactorTextBox.Text = baseParams.ElectricityProductionFactor.ToString(); }
private void BaseYearsComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { //Todo: update here , get from DB baseParams.BaseYear = 2005 + BaseYearsComboBox.SelectedIndex; baseParams.BaseYearSelectedIndex = BaseYearsComboBox.SelectedIndex; MaintenanceParams maintenanceParams = Parameter.Maintenance; maintenanceParams.Refresh(); (MainWindow.DemoInstance as Demo).RefreshComputation(); }