mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-25 14:15:00 +00:00
fix: Dynamic load copyright (#1030)
This commit is contained in:
parent
caca1dcaaf
commit
57cb9d0909
13 changed files with 14 additions and 13 deletions
|
@ -52,7 +52,7 @@
|
|||
|
||||
<TextBlock Margin="2,0,0,0" Text="{DynamicResource Text.About.SubTitle}" FontSize="16"/>
|
||||
|
||||
<TextBlock Margin="2,8,0,0" Text="{DynamicResource Text.About.Copyright}" Foreground="{DynamicResource Brush.FG2}"/>
|
||||
<TextBlock Margin="2,8,0,0" Text="{Binding Copyright}" Foreground="{DynamicResource Brush.FG2}"/>
|
||||
|
||||
<StackPanel Orientation="Vertical" Margin="0,24,0,0">
|
||||
<StackPanel Orientation="Horizontal" Height="18">
|
||||
|
|
|
@ -11,11 +11,21 @@ namespace SourceGit.Views
|
|||
private set;
|
||||
}
|
||||
|
||||
public string Copyright
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public About()
|
||||
{
|
||||
var ver = Assembly.GetExecutingAssembly().GetName().Version;
|
||||
if (ver != null)
|
||||
Version = $"{ver.Major}.{ver.Minor}";
|
||||
var attributes = Assembly.GetExecutingAssembly()
|
||||
.GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
|
||||
if (attributes.Length > 0)
|
||||
Copyright = ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
|
||||
|
||||
DataContext = this;
|
||||
InitializeComponent();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue