Browse Source
Merge pull request #5311 from jp2masa/about-dialog-version
Fixed Avalonia version in About dialog
pull/5331/head
Dan Walmsley
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
11 additions and
4 deletions
-
src/Avalonia.Dialogs/AboutAvaloniaDialog.xaml
-
src/Avalonia.Dialogs/AboutAvaloniaDialog.xaml.cs
|
|
|
@ -79,8 +79,8 @@ |
|
|
|
<DrawingPresenter Drawing="{DynamicResource AvaloniaLogo}" /> |
|
|
|
</Border> |
|
|
|
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10,-10,0,0"> |
|
|
|
<TextBlock Text="Avalonia 0.9" FontSize="40" Foreground="White" /> |
|
|
|
<TextBlock Text="Development Build" Margin="0,-10,0,0" FontSize="15" Foreground="White" /> |
|
|
|
<TextBlock Text="{Binding Version, StringFormat=Avalonia {0}}" FontSize="40" Foreground="White" /> |
|
|
|
<TextBlock Text="Development Build" IsVisible="{Binding IsDevelopmentBuild}" Margin="0,-10,0,0" FontSize="15" Foreground="White" /> |
|
|
|
</StackPanel> |
|
|
|
</StackPanel> |
|
|
|
<StackPanel HorizontalAlignment="Stretch" VerticalAlignment="Center" Spacing="20" Margin="10 60 10 0"> |
|
|
|
@ -102,4 +102,4 @@ |
|
|
|
<TextBlock Text="© 2020 The Avalonia Project" TextWrapping="Wrap" HorizontalAlignment="Center" /> |
|
|
|
</StackPanel> |
|
|
|
</Grid> |
|
|
|
</Window> |
|
|
|
</Window> |
|
|
|
|
|
|
|
@ -1,3 +1,4 @@ |
|
|
|
using System; |
|
|
|
using System.Diagnostics; |
|
|
|
using System.Runtime.InteropServices; |
|
|
|
using Avalonia.Controls; |
|
|
|
@ -7,12 +8,18 @@ namespace Avalonia.Dialogs |
|
|
|
{ |
|
|
|
public class AboutAvaloniaDialog : Window |
|
|
|
{ |
|
|
|
private static readonly Version s_version = typeof(AboutAvaloniaDialog).Assembly.GetName().Version; |
|
|
|
|
|
|
|
public static string Version { get; } = s_version.ToString(2); |
|
|
|
|
|
|
|
public static bool IsDevelopmentBuild { get; } = s_version.Revision == 999; |
|
|
|
|
|
|
|
public AboutAvaloniaDialog() |
|
|
|
{ |
|
|
|
AvaloniaXamlLoader.Load(this); |
|
|
|
DataContext = this; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static void OpenBrowser(string url) |
|
|
|
{ |
|
|
|
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) |
|
|
|
|