diff --git a/ILSpy/MainWindow.xaml.cs b/ILSpy/MainWindow.xaml.cs index e78c4f7f8..298e5ca75 100644 --- a/ILSpy/MainWindow.xaml.cs +++ b/ILSpy/MainWindow.xaml.cs @@ -102,6 +102,9 @@ namespace ICSharpCode.ILSpy MessageBus.Send(this, new ApplySessionSettingsEventArgs(sessionSettings)); sessionSettings.WindowBounds = this.RestoreBounds; + // store window state in settings only if it's not minimized + if (this.WindowState != WindowState.Minimized) + sessionSettings.WindowState = this.WindowState; sessionSettings.DockLayout.Serialize(new(DockManager)); snapshot.Save(); diff --git a/ILSpy/Search/SearchPaneModel.cs b/ILSpy/Search/SearchPaneModel.cs index a9f5444fc..f27acf105 100644 --- a/ILSpy/Search/SearchPaneModel.cs +++ b/ILSpy/Search/SearchPaneModel.cs @@ -54,6 +54,12 @@ namespace ICSharpCode.ILSpy.Search SearchTerm = e.SearchTerm; Show(); }; + MessageBus.Subscribers += ApplySessionSettings; + } + + private void ApplySessionSettings(object sender, ApplySessionSettingsEventArgs e) + { + e.SessionSettings.SelectedSearchMode = SessionSettings.SelectedSearchMode; } public SearchModeModel[] SearchModes { get; } = [