From 03bf310629fc5e571a7c1df424e7d77787f8fb89 Mon Sep 17 00:00:00 2001 From: Markus Quaritsch <markus.quaritsch@tugraz.at> Date: Fri, 3 Sep 2021 08:33:52 +0200 Subject: [PATCH] allow parameters to be null --- .../Implementation/InterimStageBusVehicleViewModel_v2_8.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/InterimStageBusVehicleViewModel_v2_8.cs b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/InterimStageBusVehicleViewModel_v2_8.cs index 58f60ceea3..00b9ff9e37 100644 --- a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/InterimStageBusVehicleViewModel_v2_8.cs +++ b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/InterimStageBusVehicleViewModel_v2_8.cs @@ -1185,13 +1185,13 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation case nameof(EcoRollTypeNullable): case nameof(EngineStopStartNullable): case nameof(PredictiveCruiseControlNullable): - case nameof(ATEcoRollReleaseLockupClutch): - if (AdasEditingEnabled == true && this.GetType().GetProperty(propertyName).GetValue(this) == null){ + case nameof(ATEcoRollReleaseLockupClutch): // only required for AT transmission + if (AdasEditingEnabled == true && (!_parameterViewModels[propertyName].AllowNullValue && this.GetType().GetProperty(propertyName).GetValue(this) == null)) { result = $"{NameResolver.ResolveName(propertyName, BusStrings.ResourceManager, Strings.ResourceManager)} has to be set if editing is enabled."; } break; default: - if (_parameterViewModels[propertyName].EditingEnabled) { + if (_parameterViewModels[propertyName].EditingEnabled && !_parameterViewModels[propertyName].AllowNullValue) { var propertyValue = this.GetType().GetProperty(propertyName)?.GetValue(this); if (propertyValue == null) { result = -- GitLab