From 856d3fafe8d328736041e51a8597c164b04d4577 Mon Sep 17 00:00:00 2001 From: Giuseppe Sorrentino Date: Fri, 6 Jan 2023 00:21:51 +0100 Subject: [PATCH] added a quick and dirty about tab --- AmethystWindows/MainWindow.xaml | 12 +++++++++++- AmethystWindows/MainWindowViewModel.cs | 20 ++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/AmethystWindows/MainWindow.xaml b/AmethystWindows/MainWindow.xaml index ccd07c5..749180d 100644 --- a/AmethystWindows/MainWindow.xaml +++ b/AmethystWindows/MainWindow.xaml @@ -207,7 +207,7 @@ - + @@ -216,6 +216,16 @@ + + + + Amthyst Windows + + + + + + diff --git a/AmethystWindows/MainWindowViewModel.cs b/AmethystWindows/MainWindowViewModel.cs index 0cc8eb8..6e736d1 100644 --- a/AmethystWindows/MainWindowViewModel.cs +++ b/AmethystWindows/MainWindowViewModel.cs @@ -12,10 +12,14 @@ using System.Diagnostics; using System.Globalization; using System.Linq; +using System.Threading.Tasks; using System.Windows; +using System.Windows.Controls; using System.Windows.Data; using System.Windows.Input; using Vanara.PInvoke; +using Windows.ApplicationModel; +using Windows.Data.Xml.Dom; using Windows.Foundation.Collections; using WindowsDesktop; @@ -29,6 +33,8 @@ public class ViewModelDesktopWindow public string VirtualDesktop { get; set; } public string Monitor { get; set; } + public string Version { get; set; } + public ViewModelDesktopWindow(string appName, string className) { AppName = appName; @@ -162,6 +168,7 @@ public class MainWindowViewModel : ObservableRecipient private int _virtualDesktops; private bool _disabled; + private string _version; private List> _configurableFilters; private Pair _selectedConfigurableFilter; @@ -186,6 +193,7 @@ public MainWindowViewModel() _step = !MySettings.Instance.Step.Equals(null) ? MySettings.Instance.Step : 25; _disabled = !MySettings.Instance.Disabled.Equals(null) ? MySettings.Instance.Disabled : false; + _version = getVersion(); _configurableFilters = MySettings.Instance.Filters; _configurableAdditions = MySettings.Instance.Additions; @@ -339,6 +347,12 @@ public bool Disabled set => SetProperty(ref _disabled, value); } + public string Version + { + get => _version; + set => SetProperty(ref _version, value); + } + public ObservableDesktopMonitors DesktopMonitors { get => _desktopMonitors; @@ -464,6 +478,12 @@ private void Closing(CancelEventArgs? e) e.Cancel = true; WindowState = WindowState.Minimized; } + + private string getVersion() + { + var version = Package.Current.Id.Version; + return $"{version.Major}.{version.Minor}.{version.Build}.{version.Revision}"; + } } public class ViewModelDesktopMonitor : INotifyPropertyChanged