fix: Use consistent window-type ids for saving/loading vs wins
Bugs (fixed): The vol surface, and exp params windows aren't restored with workspace
This commit is contained in:
1 parent
c65c16f476
commit
eade3d0ee3
3 files changed
+7
-11
No files matched your search
@@ -8,7 +8,7 @@
|
||||
using System.Windows;
|
||||
|
||||
class AnalyticsExpirationParametersWindow : SparkWindow<AnalyticsExpirationParametersSettings> {
|
||||
const string _window_type = nameof(AnalyticsExpirationParametersWindow);
|
||||
public const string WINDOW_TYPE = "Analytics Expiration Parameters";
|
||||
|
||||
readonly Lazy<AnalyticsParametersUIModel> _model;
|
||||
readonly Lazy<AnalyticsExpirationParametersVM> _vm;
|
||||
@@ -29,7 +29,7 @@
|
||||
});
|
||||
}
|
||||
|
||||
public override string window_type => _window_type;
|
||||
public override string window_type => WINDOW_TYPE;
|
||||
|
||||
public override AnalyticsExpirationParametersSettings SaveState =>
|
||||
_vm.IsValueCreated ? _vm.Value.get_state() : null;
|
||||
|
||||
@@ -7,7 +7,6 @@ namespace mbts.spark {
|
||||
|
||||
using mbts.analytics;
|
||||
using mbts.ui;
|
||||
using mbts.ui.controls;
|
||||
using mbts.ui.shell;
|
||||
|
||||
using System;
|
||||
@@ -24,10 +23,6 @@ namespace mbts.spark {
|
||||
|
||||
[Export(typeof(IShellModule))]
|
||||
class VolSurfaceModule : ViewModelBase, IShellModule, IShellModuleViewFactory {
|
||||
public const string ANALYTICS_EXPIRATION_PARAMETERS_HEADER = "Analytics Expiration Parameters";
|
||||
public const string MAIN_WINDOW_HEADER = "Main Window";
|
||||
public const string DETAILED_GRID_HEADER = "Detailed Grid";
|
||||
|
||||
readonly IBus _bus;
|
||||
readonly IWindowManager _wm;
|
||||
readonly VolSurfaceWindowFactory _vol_surface_window_factory;
|
||||
@@ -94,8 +89,8 @@ namespace mbts.spark {
|
||||
|
||||
IShellWindowFactory _window_factory_for_header(string header) =>
|
||||
header switch {
|
||||
MAIN_WINDOW_HEADER => _vol_surface_window_factory,
|
||||
ANALYTICS_EXPIRATION_PARAMETERS_HEADER => _exp_params_window_factory,
|
||||
VolSurfaceWindow.WINDOW_TYPE => _vol_surface_window_factory,
|
||||
AnalyticsExpirationParametersWindow.WINDOW_TYPE => _exp_params_window_factory,
|
||||
_ => null,
|
||||
};
|
||||
|
||||
|
||||
@@ -6,13 +6,14 @@
|
||||
using mbts.ui;
|
||||
using mbts.ui.extensions;
|
||||
using mbts.ui.shell;
|
||||
using mbts.ui.utility;
|
||||
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
class VolSurfaceWindow : SparkWindow<VolSurfaceWindowSettings>, ISharedWindow {
|
||||
public const string WINDOW_TYPE = "VolSurface";
|
||||
|
||||
readonly VolSurfaceWindowSettings _startup_data;
|
||||
readonly IWindowManager _window_manager;
|
||||
|
||||
@@ -36,7 +37,7 @@
|
||||
public int vs_id => _startup_data.id;
|
||||
public string vs_name { get; }
|
||||
|
||||
static string _window_type => "VolSurface";
|
||||
static string _window_type => WINDOW_TYPE;
|
||||
|
||||
public override VolSurfaceWindowSettings SaveState => _vm?.get_startup_data();
|
||||
public override UIElement Content => _dummy_view;
|
||||
|
||||
Reference in new issue
Block a user