Add version number display to main window
This commit is contained in:
@@ -19,11 +19,16 @@
|
|||||||
|
|
||||||
<!-- Header -->
|
<!-- Header -->
|
||||||
<Grid Grid.Row="0" Margin="0,0,0,15">
|
<Grid Grid.Row="0" Margin="0,0,0,15">
|
||||||
|
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Left">
|
||||||
<TextBlock Text="NFC Actions Configuration"
|
<TextBlock Text="NFC Actions Configuration"
|
||||||
FontSize="20"
|
FontSize="20"
|
||||||
FontWeight="Bold"
|
FontWeight="Bold"/>
|
||||||
VerticalAlignment="Center"
|
<TextBlock x:Name="VersionText"
|
||||||
HorizontalAlignment="Left"/>
|
Text="v1.0.3"
|
||||||
|
FontSize="10"
|
||||||
|
Foreground="Gray"
|
||||||
|
Margin="0,2,0,0"/>
|
||||||
|
</StackPanel>
|
||||||
<Image Source="Resources/logo.png"
|
<Image Source="Resources/logo.png"
|
||||||
Height="60"
|
Height="60"
|
||||||
HorizontalAlignment="Right"
|
HorizontalAlignment="Right"
|
||||||
|
|||||||
@@ -19,6 +19,13 @@ public partial class MainWindow : Window
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
DataContext = viewModel;
|
DataContext = viewModel;
|
||||||
|
|
||||||
|
// Set version number from assembly
|
||||||
|
var version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
|
||||||
|
if (version != null)
|
||||||
|
{
|
||||||
|
VersionText.Text = $"v{version.Major}.{version.Minor}.{version.Build}";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Window_Closing(object? sender, CancelEventArgs e)
|
private void Window_Closing(object? sender, CancelEventArgs e)
|
||||||
|
|||||||
Reference in New Issue
Block a user