diff --git a/src/client/spark/Modules/Spreader/ExecutionStrategyEditor.xaml.cs b/src/client/spark/Modules/Spreader/ExecutionStrategyEditor.xaml.cs index 4b9b2c2f4..ad23a28c7 100644 --- a/src/client/spark/Modules/Spreader/ExecutionStrategyEditor.xaml.cs +++ b/src/client/spark/Modules/Spreader/ExecutionStrategyEditor.xaml.cs @@ -317,6 +317,7 @@ namespace mbts.ui.spark { _name_text_box = null; _tick_combo_box = null; }); + InvalidateVisual(); } } diff --git a/src/client/spark/Modules/Spreader/VM/SyntheticEditorVM.cs b/src/client/spark/Modules/Spreader/VM/SyntheticEditorVM.cs index 0cb3ee421..feb6eb516 100644 --- a/src/client/spark/Modules/Spreader/VM/SyntheticEditorVM.cs +++ b/src/client/spark/Modules/Spreader/VM/SyntheticEditorVM.cs @@ -86,11 +86,11 @@ namespace mbts.spark { } }, () => leg_count > 0); _deduce_ticks(); + _validate_leg_count(); leg_tuples.CollectionChanged += (s, e) => { if (_set_ticks_automatically) _deduce_ticks(); commit.RaiseCanExecuteChanged(); - if (leg_count < 2) set_error(nameof(leg_count), "Please select 2 or more legs"); - else clear_error(nameof(leg_count)); + _validate_leg_count(); }; } @@ -179,5 +179,10 @@ namespace mbts.spark { is_new_leg_popup_open = false; RaisePropertyChanged(nameof(is_new_leg_popup_open)); } + + void _validate_leg_count() { + if (leg_count < 2) set_error(nameof(leg_count), "Please select 2 or more legs"); + else clear_error(nameof(leg_count)); + } } } \ No newline at end of file