diff --git a/MessageCommunicator.TestGui/ViewServices/_AboutDialog/AboutDialogControl.xaml b/MessageCommunicator.TestGui/ViewServices/_AboutDialog/AboutDialogControl.xaml
index 2f6e13c..f7c7531 100644
--- a/MessageCommunicator.TestGui/ViewServices/_AboutDialog/AboutDialogControl.xaml
+++ b/MessageCommunicator.TestGui/ViewServices/_AboutDialog/AboutDialogControl.xaml
@@ -8,7 +8,19 @@
Width="610" Height="400"
x:Class="MessageCommunicator.TestGui.ViewServices.AboutDialogControl">
-
- About ;)
-
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/MessageCommunicator.TestGui/ViewServices/_AboutDialog/AboutDialogControl.xaml.cs b/MessageCommunicator.TestGui/ViewServices/_AboutDialog/AboutDialogControl.xaml.cs
index 4fc3349..88b6620 100644
--- a/MessageCommunicator.TestGui/ViewServices/_AboutDialog/AboutDialogControl.xaml.cs
+++ b/MessageCommunicator.TestGui/ViewServices/_AboutDialog/AboutDialogControl.xaml.cs
@@ -10,7 +10,7 @@
namespace MessageCommunicator.TestGui.ViewServices
{
- public class AboutDialogControl : OwnUserControlDialog
+ public class AboutDialogControl : OwnUserControlDialog
{
public AboutDialogControl()
{
diff --git a/MessageCommunicator.TestGui/ViewServices/_AboutDialog/AboutDialogService.cs b/MessageCommunicator.TestGui/ViewServices/_AboutDialog/AboutDialogService.cs
index e2bda6e..bf13838 100644
--- a/MessageCommunicator.TestGui/ViewServices/_AboutDialog/AboutDialogService.cs
+++ b/MessageCommunicator.TestGui/ViewServices/_AboutDialog/AboutDialogService.cs
@@ -18,7 +18,8 @@ public AboutDialogService(DialogHostControl host)
public Task ShowAboutDialogAsync()
{
var aboutDialogControl = new AboutDialogControl();
- return _host.ShowDialogAsync(aboutDialogControl, "About");
+ aboutDialogControl.DataContext = new AboutDialogViewModel();
+ return aboutDialogControl.ShowControlDialogAsync(_host, "About");
}
}
}
diff --git a/MessageCommunicator.TestGui/ViewServices/_AboutDialog/AboutDialogViewModel.cs b/MessageCommunicator.TestGui/ViewServices/_AboutDialog/AboutDialogViewModel.cs
new file mode 100644
index 0000000..5f1f6aa
--- /dev/null
+++ b/MessageCommunicator.TestGui/ViewServices/_AboutDialog/AboutDialogViewModel.cs
@@ -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();
+ return asmAttribute?.Product ?? string.Empty;
+ }
+ }
+
+ public string Version
+ {
+ get
+ {
+ var asmAttribute = Assembly.GetExecutingAssembly().GetCustomAttribute();
+ return asmAttribute?.InformationalVersion ?? string.Empty;
+ }
+ }
+
+ public string Description
+ {
+ get
+ {
+ var asmAttribute = Assembly.GetExecutingAssembly().GetCustomAttribute();
+ return asmAttribute?.Description ?? string.Empty;
+ }
+ }
+
+ public string Homepage
+ {
+ get => "https://github.com/RolandKoenig/MessageCommunicator";
+ }
+
+ public string Author
+ {
+ get
+ {
+ var asmAttribute = Assembly.GetExecutingAssembly().GetCustomAttribute();
+ return asmAttribute?.Company ?? string.Empty;
+ }
+ }
+
+ public string Copyright
+ {
+ get
+ {
+ var asmAttribute = Assembly.GetExecutingAssembly().GetCustomAttribute();
+ return asmAttribute?.Copyright ?? string.Empty;
+ }
+ }
+
+ public string TargetFramework
+ {
+ get
+ {
+ var asmAttribute = Assembly.GetExecutingAssembly().GetCustomAttribute();
+ return asmAttribute?.FrameworkName ?? string.Empty;
+ }
+ }
+
+ public string AvaloniaVersion
+ {
+ get
+ {
+ var asmAttribute = typeof(Window).Assembly.GetCustomAttribute();
+ return asmAttribute?.InformationalVersion?? string.Empty;
+ }
+ }
+
+ [Browsable(false)]
+ public ReactiveCommand Command_Close { get; }
+
+ [Browsable(false)]
+ public AboutDialogViewModel Self => this;
+
+ public AboutDialogViewModel()
+ {
+ this.Command_Close = ReactiveCommand.Create(() => this.CloseWindow(null));
+ }
+ }
+}
diff --git a/MessageCommunicator.TestGui/_Util/_View/DialogHostControl.cs b/MessageCommunicator.TestGui/_Util/_View/DialogHostControl.cs
index 460e580..ab8f118 100644
--- a/MessageCommunicator.TestGui/_Util/_View/DialogHostControl.cs
+++ b/MessageCommunicator.TestGui/_Util/_View/DialogHostControl.cs
@@ -38,11 +38,6 @@ public DialogHostControl()
}
public void ShowDialog(Control controlToShow, string headerText)
- {
- this.ShowDialogAsync(controlToShow, headerText);
- }
-
- public Task ShowDialogAsync(Control controlToShow, string headerText)
{
var currentChild = controlToShow;
var currentChildInitialSize = new Size(currentChild.Width, currentChild.Height);
@@ -61,11 +56,9 @@ public Task ShowDialogAsync(Control controlToShow, string headerText)
var currentBackground = new Grid();
currentBackground.Background = _backgroundDialog;
- var taskComplSource = new TaskCompletionSource