Browse Source

Show the full version in the title bar on DEBUG builds

Matches the WPF behaviour at master:ILSpy/AssemblyTree/AssemblyTreeModel.cs:440
where DEBUG builds get "ILSpy {DecompilerVersionInfo.FullVersion}" so the
developer can tell from a glance which build the running window came from
(especially handy when the avalonia-preview tag floats forward and several
windows are open at once). Release builds keep the bare "ILSpy" title.

The title is bound from MainWindowViewModel.Title (axaml: Title="{Binding
Title}"), so threading the version through the VM is the natural seam --
no axaml change and the bound value can later be made notifying if we
want to mix in the active assembly-list name.

Assisted-by: Claude:claude-opus-4-7:Claude Code
pull/3755/head
Siegfried Pammer 1 month ago
parent
commit
fe45e370d4
  1. 4
      ILSpy.Tests/MainWindow/MainWindowTests.cs
  2. 7
      ILSpy/ViewModels/MainWindowViewModel.cs

4
ILSpy.Tests/MainWindow/MainWindowTests.cs

@ -53,7 +53,9 @@ public class MainWindowTests @@ -53,7 +53,9 @@ public class MainWindowTests
// Assert — visible, titled, with the correct DataContext.
window.IsVisible.Should().BeTrue();
window.Title.Should().Be("ILSpy");
// DEBUG builds append the full version (e.g. "ILSpy 11.0.0.x-<branch>-pre") to the
// title bar, so match the prefix rather than the exact string.
window.Title.Should().StartWith("ILSpy");
window.DataContext.Should().BeOfType<MainWindowViewModel>();
}

7
ILSpy/ViewModels/MainWindowViewModel.cs

@ -44,7 +44,12 @@ namespace ILSpy.ViewModels @@ -44,7 +44,12 @@ namespace ILSpy.ViewModels
public System.Collections.Generic.IReadOnlyList<ToolPaneMenuItem> ToolPaneMenuItems => DockWorkspace.ToolPaneMenuItems;
public string Title => "ILSpy";
public string Title =>
#if DEBUG
$"ILSpy {DecompilerVersionInfo.FullVersion}";
#else
"ILSpy";
#endif
[ImportingConstructor]
public MainWindowViewModel(

Loading…
Cancel
Save