Add version number display to main window
This commit is contained in:
@@ -19,11 +19,16 @@
|
||||
|
||||
<!-- Header -->
|
||||
<Grid Grid.Row="0" Margin="0,0,0,15">
|
||||
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Left">
|
||||
<TextBlock Text="NFC Actions Configuration"
|
||||
FontSize="20"
|
||||
FontWeight="Bold"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Left"/>
|
||||
FontWeight="Bold"/>
|
||||
<TextBlock x:Name="VersionText"
|
||||
Text="v1.0.3"
|
||||
FontSize="10"
|
||||
Foreground="Gray"
|
||||
Margin="0,2,0,0"/>
|
||||
</StackPanel>
|
||||
<Image Source="Resources/logo.png"
|
||||
Height="60"
|
||||
HorizontalAlignment="Right"
|
||||
|
||||
@@ -19,6 +19,13 @@ public partial class MainWindow : Window
|
||||
{
|
||||
InitializeComponent();
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user