-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
082fa84
commit 9683e0c
Showing
7 changed files
with
129 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
94 changes: 94 additions & 0 deletions
94
MessageCommunicator.TestGui/ViewServices/_AboutDialog/AboutDialogViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel; | ||
using System.Reactive; | ||
using System.Reflection; | ||
using System.Runtime.Versioning; | ||
using System.Text; | ||
using Avalonia.Controls; | ||
using ReactiveUI; | ||
|
||
namespace MessageCommunicator.TestGui.ViewServices | ||
{ | ||
public class AboutDialogViewModel : OwnViewModelBase | ||
{ | ||
public string Name | ||
{ | ||
get | ||
{ | ||
var asmAttribute = Assembly.GetExecutingAssembly().GetCustomAttribute<AssemblyProductAttribute>(); | ||
return asmAttribute?.Product ?? string.Empty; | ||
} | ||
} | ||
|
||
public string Version | ||
{ | ||
get | ||
{ | ||
var asmAttribute = Assembly.GetExecutingAssembly().GetCustomAttribute<AssemblyInformationalVersionAttribute>(); | ||
return asmAttribute?.InformationalVersion ?? string.Empty; | ||
} | ||
} | ||
|
||
public string Description | ||
{ | ||
get | ||
{ | ||
var asmAttribute = Assembly.GetExecutingAssembly().GetCustomAttribute<AssemblyDescriptionAttribute>(); | ||
return asmAttribute?.Description ?? string.Empty; | ||
} | ||
} | ||
|
||
public string Homepage | ||
{ | ||
get => "https://github.com/RolandKoenig/MessageCommunicator"; | ||
} | ||
|
||
public string Author | ||
{ | ||
get | ||
{ | ||
var asmAttribute = Assembly.GetExecutingAssembly().GetCustomAttribute<AssemblyCompanyAttribute>(); | ||
return asmAttribute?.Company ?? string.Empty; | ||
} | ||
} | ||
|
||
public string Copyright | ||
{ | ||
get | ||
{ | ||
var asmAttribute = Assembly.GetExecutingAssembly().GetCustomAttribute<AssemblyCopyrightAttribute>(); | ||
return asmAttribute?.Copyright ?? string.Empty; | ||
} | ||
} | ||
|
||
public string TargetFramework | ||
{ | ||
get | ||
{ | ||
var asmAttribute = Assembly.GetExecutingAssembly().GetCustomAttribute<TargetFrameworkAttribute>(); | ||
return asmAttribute?.FrameworkName ?? string.Empty; | ||
} | ||
} | ||
|
||
public string AvaloniaVersion | ||
{ | ||
get | ||
{ | ||
var asmAttribute = typeof(Window).Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>(); | ||
return asmAttribute?.InformationalVersion?? string.Empty; | ||
} | ||
} | ||
|
||
[Browsable(false)] | ||
public ReactiveCommand<Unit, Unit> Command_Close { get; } | ||
|
||
[Browsable(false)] | ||
public AboutDialogViewModel Self => this; | ||
|
||
public AboutDialogViewModel() | ||
{ | ||
this.Command_Close = ReactiveCommand.Create(() => this.CloseWindow(null)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters