From abe9164912eed5a299eb2cb9ad41c1cbcc30628f Mon Sep 17 00:00:00 2001 From: Hirek193 Date: Tue, 16 Jun 2026 23:00:06 +0200 Subject: [PATCH] Version binding --- StarterNG/AppInfo.cs | 23 +++++++++++++++++++++++ StarterNG/MainWindow.axaml | 1 + StarterNG/MainWindow.axaml.cs | 3 +++ StarterNG/StarterNG.csproj | 2 ++ 4 files changed, 29 insertions(+) create mode 100644 StarterNG/AppInfo.cs diff --git a/StarterNG/AppInfo.cs b/StarterNG/AppInfo.cs new file mode 100644 index 0000000..71fffbe --- /dev/null +++ b/StarterNG/AppInfo.cs @@ -0,0 +1,23 @@ +using System.Reflection; + +namespace StarterNG; + +/// Static, display-ready information about the running launcher build. +public static class AppInfo +{ + /// + /// The launcher's assembly version (e.g. "1.2.3.4"), with a " (DEBUG)" suffix + /// appended for Debug builds so debug and release binaries are easy to tell + /// apart. Computed once; safe to bind with {x:Static}. + /// + public static string Version { get; } = BuildVersion(); + + private static string BuildVersion() + { + string text = Assembly.GetExecutingAssembly().GetName().Version?.ToString() ?? "0.0.0.0"; +#if DEBUG + text += " (DEBUG)"; +#endif + return text; + } +} diff --git a/StarterNG/MainWindow.axaml b/StarterNG/MainWindow.axaml index 9845967..0f0ccc4 100644 --- a/StarterNG/MainWindow.axaml +++ b/StarterNG/MainWindow.axaml @@ -16,6 +16,7 @@ ToolTip.Tip="{Binding [ShowLatestLogTooltip], Source={x:Static starterNg:App.Loc}}"> +