SecurityPicker - exchange list is now sourced from the bus Securities and not UserSymbols
This commit is contained in:
1 parent
6c0fe62c91
commit
bfe73d7a6a
1 file changed
+10
-7
@@ -216,6 +216,7 @@ namespace mbts.spark
|
||||
.Select(entry => entry.Value.security)
|
||||
);
|
||||
|
||||
_update_exchanges();
|
||||
_update_security_types();
|
||||
_update_symbols();
|
||||
_update_securities();
|
||||
@@ -235,13 +236,8 @@ namespace mbts.spark
|
||||
security_criteria_clause_changed?.Invoke(this, e);
|
||||
}
|
||||
|
||||
public List<Venue> all_exchanges {
|
||||
get {
|
||||
var distinct_exchanges = UserSymbol.get_all().Select(x => x.exchange).Distinct().ToList();
|
||||
distinct_exchanges.Sort();
|
||||
return distinct_exchanges;
|
||||
}
|
||||
}
|
||||
public ObservableCollection<Venue> all_exchanges { get; } = new ObservableCollection<Venue>();
|
||||
|
||||
public List<Venue> selected_exchanges = new List<Venue>();
|
||||
|
||||
public ObservableCollection<SecurityType> security_types { get; } = new ObservableCollection<SecurityType>(); //EnumHelper.get_values_except(SecurityType.Option, SecurityType.Stock, SecurityType.Unset);
|
||||
@@ -315,6 +311,13 @@ namespace mbts.spark
|
||||
}
|
||||
}
|
||||
|
||||
private void _update_exchanges() {
|
||||
all_exchanges.sync_with(all_securities
|
||||
.Select(s => s.Value.security.Exchange)
|
||||
.Distinct()
|
||||
);
|
||||
}
|
||||
|
||||
private void _update_security_types() {
|
||||
security_types.sync_with(all_securities
|
||||
.Where(s => selected_exchanges
|
||||
|
||||
Reference in new issue
Block a user