ensure latest column settings retrieved from GridSettingsManager
This commit is contained in:
1 parent
0b73e2744e
commit
860bda388f
4 files changed
+13
-3
No files matched your search
@@ -205,7 +205,7 @@ namespace mbts.spark {
|
||||
if (_settings_manager.instance_settings == null)
|
||||
return null;
|
||||
else
|
||||
return grid_settings_manager.grid_settings;
|
||||
return grid_settings_manager.create();
|
||||
}
|
||||
|
||||
public FillsFilterStates get_filters() =>
|
||||
|
||||
@@ -696,7 +696,7 @@ namespace mbts.spark {
|
||||
new OrderBookFillsGridSettings {
|
||||
sorting_criterion = fills_vm.get_sorting_criterion().ToList(),
|
||||
filters = fills_vm.get_filters(),
|
||||
general = fills_vm.grid_settings_manager.grid_settings
|
||||
general = fills_vm.grid_settings_manager.create()
|
||||
};
|
||||
|
||||
static OrderRecordTuplePredicate.PredicateTypeOneofCase _corresponding_predicate_type(Columns col) {
|
||||
|
||||
@@ -78,7 +78,7 @@ namespace bts.shell.orderbook {
|
||||
|
||||
public OrderBookGridSettings create(IEnumerable<SortingCriteria> sorting_criterion) =>
|
||||
new OrderBookGridSettings(
|
||||
core_manager.grid_settings,
|
||||
core_manager.create(),
|
||||
_predicate_animations.ToList()) {
|
||||
algo_tree_display_mode = _algo_tree_display_mode
|
||||
};
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using bts;
|
||||
using bts.utils;
|
||||
using mbts.spark;
|
||||
using mbts.ui.settings;
|
||||
@@ -44,6 +45,15 @@ namespace mbts.ui {
|
||||
public SolidColorBrush selection_highlight => _selection_highlight.Value;
|
||||
public SolidColorBrush background_color => _background_color.Value;
|
||||
|
||||
public GridSettings create() {
|
||||
try {
|
||||
_grid_settings.set(grid_settings.with(columns: _columns.Select(c => c.create())));
|
||||
} catch (Exception ex) {
|
||||
Log.Ui.warn($"Error refreshing grid settings (may be benign, if caused by accessing a ColumnBase property after window closed): {ex}.");
|
||||
}
|
||||
return grid_settings;
|
||||
}
|
||||
|
||||
public GridSettingsVM create_vm() =>
|
||||
new GridSettingsVM(_column_flags?.ToDictionary(kv => kv.Key, kv => kv.Value.flags));
|
||||
|
||||
|
||||
Reference in new issue
Block a user