diff --git a/ILSpy/AssemblyTree/AssemblyTreeModel.cs b/ILSpy/AssemblyTree/AssemblyTreeModel.cs index fbf01343b7..3fba90aea7 100644 --- a/ILSpy/AssemblyTree/AssemblyTreeModel.cs +++ b/ILSpy/AssemblyTree/AssemblyTreeModel.cs @@ -418,17 +418,22 @@ void ShowAssemblyList(AssemblyList assemblyList) 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 }