From 22c5735adaf6804ca7de09a2ae9fea5b62b825cb Mon Sep 17 00:00:00 2001 From: tom-englert Date: Mon, 23 Sep 2024 09:58:21 +0200 Subject: [PATCH] Fix #3284: AssemblyTree title is wrong --- ILSpy/AssemblyTree/AssemblyTreeModel.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/ILSpy/AssemblyTree/AssemblyTreeModel.cs b/ILSpy/AssemblyTree/AssemblyTreeModel.cs index fbf01343b..3fba90aea 100644 --- a/ILSpy/AssemblyTree/AssemblyTreeModel.cs +++ b/ILSpy/AssemblyTree/AssemblyTreeModel.cs @@ -418,17 +418,22 @@ namespace ICSharpCode.ILSpy.AssemblyTree Root = assemblyListTreeNode; + var mainWindow = Application.Current?.MainWindow; + + if (mainWindow == null) + return; + if (assemblyList.ListName == AssemblyListManager.DefaultListName) #if DEBUG - this.Title = $"ILSpy {DecompilerVersionInfo.FullVersion}"; + mainWindow.Title = $"ILSpy {DecompilerVersionInfo.FullVersion}"; #else - this.Title = "ILSpy"; + mainWindow.Title = "ILSpy"; #endif else #if DEBUG - this.Title = $"ILSpy {DecompilerVersionInfo.FullVersion} - " + assemblyList.ListName; + mainWindow.Title = $"ILSpy {DecompilerVersionInfo.FullVersion} - " + assemblyList.ListName; #else - this.Title = "ILSpy - " + assemblyList.ListName; + mainWindow.Title = "ILSpy - " + assemblyList.ListName; #endif }