OrderPropertiesEditor - open algo popup when user selects new algo
This commit is contained in:
1 parent
abd2b4c5f2
commit
ddc297d413
2 files changed
+7
No files matched your search
@@ -173,6 +173,12 @@ namespace mbts.spark {
|
||||
_order_type_param_errors_sub = ndei.subscribe_errors_changed((s, e) => assert_no_param_errors());
|
||||
void assert_no_param_errors() => assert(!ndei.HasErrors, "order type pararmeters invalid.");
|
||||
}
|
||||
/// This is a bit of a hack; the goal is to open the algo popup menu when users select a new algo.
|
||||
/// It isn't as straightforward as it sounds bc there are a couple non-user-invoked scenarios which ellicit calls to the SelectorProperty.selected_item's public setter:
|
||||
/// 1) a selected-order-type default value is observed from an IObservable settings source, which may overwrite the current selection, esp if the current value is null.
|
||||
/// 2) the order-type itemssource is observed from an IObservable settings source as well, which may cause the current selection to be changed by the view, if the itemssource no longer contains the currently selected value.
|
||||
if (new_val != null && new_val == selected_order_type && _order_type.items.Contains(new_val) && selected_order_type.has_editable_properties && _order_type.is_user_selected_item && old_val != null && _order_type.items.Contains(old_val))
|
||||
selected_order_type.editable_properties_open = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -630,6 +630,7 @@ namespace mbts.ui.shell
|
||||
_set_selected_item(value);
|
||||
}
|
||||
}
|
||||
public bool is_user_selected_item => _is_user_selected_item;
|
||||
|
||||
public IDisposable Subscribe(IObserver<(TValue oldval, TValue newval)> observer) {
|
||||
Changed += pch;
|
||||
|
||||
Reference in new issue
Block a user