Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 258fd8e2 authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

allow nullable parameters - required for APT Release Lockup Clutch

parent c8d0c137
No related branches found
No related tags found
No related merge requests found
......@@ -318,6 +318,8 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation
_parameterViewModels[nameof(PredictiveCruiseControlNullable)].EditingChangedCallback = ADASGroupEditingCallback;
_parameterViewModels[nameof(ATEcoRollReleaseLockupClutch)].EditingChangedCallback = ADASGroupEditingCallback;
_parameterViewModels[nameof(ATEcoRollReleaseLockupClutch)].AllowNullValue = true;
Action<MultistageParameterViewModel> PassengerGroupEditingCallback = (MultistageParameterViewModel param) => {
NumberOfPassengersEditingEnabled = param.EditingEnabled;
};
......
......@@ -37,6 +37,7 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation
private object _currentContent;
private object _dummyContent;
private bool _mandatory;
private bool _allowNullValue;
private object _storedContent;
private string _label;
private ObservableCollection<Enum> _allowedItems;
......@@ -207,6 +208,16 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation
}
}
public bool AllowNullValue
{
get => _allowNullValue;
set
{
SetProperty(ref _allowNullValue, value);
UpdateValueFieldEditable();
}
}
public bool EditingEnabled
{
get => _editingEnabled;
......@@ -398,7 +409,7 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation
/// <returns></returns>
public bool UpdateEditingEnabled()
{
if (CurrentContent == null) {
if (!AllowNullValue && CurrentContent == null) {
EditingEnabled = false;
} else {
EditingEnabled = true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment