From c1b3a610c35c600f2444de391247332bf0acff4e Mon Sep 17 00:00:00 2001
From: Xjph <archseraphim@gmail.com>
Date: Sun, 6 Jun 2021 13:00:09 -0230
Subject: [PATCH] Automatic build number. Include in application title text.

---
 ObservatoryCore/ObservatoryCore.csproj     | 10 +++++++---
 ObservatoryCore/UI/Views/CoreView.axaml    |  4 ++--
 ObservatoryCore/UI/Views/CoreView.axaml.cs |  6 +++++-
 3 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/ObservatoryCore/ObservatoryCore.csproj b/ObservatoryCore/ObservatoryCore.csproj
index 4af6ff4..4fb6a45 100644
--- a/ObservatoryCore/ObservatoryCore.csproj
+++ b/ObservatoryCore/ObservatoryCore.csproj
@@ -12,10 +12,14 @@
     <IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
   </PropertyGroup>
 
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
-    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+  <PropertyGroup>
+    <VersionSuffix>0.0.0.$([System.DateTime]::UtcNow.ToString(mmff))</VersionSuffix>
+    <AssemblyVersion Condition=" '$(VersionSuffix)' == '' ">0.0.0.1</AssemblyVersion>
+    <AssemblyVersion Condition=" '$(VersionSuffix)' != '' ">$(VersionSuffix)</AssemblyVersion>
+    <Version Condition=" '$(VersionSuffix)' == '' ">0.0.1.0</Version>
+    <Version Condition=" '$(VersionSuffix)' != '' ">$(VersionSuffix)</Version>
   </PropertyGroup>
-
+  
   <ItemGroup>
     <PackageReference Include="Avalonia" Version="0.10.3" />
     <PackageReference Include="Avalonia.Controls.DataGrid" Version="0.10.3" />
diff --git a/ObservatoryCore/UI/Views/CoreView.axaml b/ObservatoryCore/UI/Views/CoreView.axaml
index 6437302..bdcf35b 100644
--- a/ObservatoryCore/UI/Views/CoreView.axaml
+++ b/ObservatoryCore/UI/Views/CoreView.axaml
@@ -6,8 +6,8 @@
              mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
              x:Class="Observatory.UI.Views.CoreView">
   <Grid RowDefinitions="30,*,Auto">
-    <TextBlock Grid.Row="0" VerticalAlignment="Center" Padding="10,0,0,0">
-      Elite Observatory - v1.0core
+    <TextBlock Grid.Row="0" VerticalAlignment="Center" Padding="10,0,0,0" Name="Title">
+      Elite Observatory - v0
     </TextBlock>
     <TabControl Name="CoreTabs"
       Grid.Row="1" Grid.Column="1"
diff --git a/ObservatoryCore/UI/Views/CoreView.axaml.cs b/ObservatoryCore/UI/Views/CoreView.axaml.cs
index 9094b8b..d0ffe44 100644
--- a/ObservatoryCore/UI/Views/CoreView.axaml.cs
+++ b/ObservatoryCore/UI/Views/CoreView.axaml.cs
@@ -9,8 +9,12 @@ namespace Observatory.UI.Views
     {
         public CoreView()
         {
-            InitializeComponent();
             
+            InitializeComponent();
+
+            var titleBlock = this.Find<TextBlock>("Title");
+            titleBlock.Text = "Elite Observatory Core - v" + System.Reflection.Assembly.GetEntryAssembly().GetName().Version.ToString();
+
         }
 
         private void InitializeComponent()