Skip to content
This repository has been archived by the owner on May 24, 2023. It is now read-only.

Commit

Permalink
added a quick and dirty about tab
Browse files Browse the repository at this point in the history
  • Loading branch information
glsorre committed Jan 5, 2023
1 parent 22a41c5 commit 856d3fa
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
12 changes: 11 additions & 1 deletion AmethystWindows/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Margin="20">
<TextBlock Width="300" VerticalAlignment="Center" Text="{Binding Path=Description, UpdateSourceTrigger=PropertyChanged}" />
<TextBlock Width="400" VerticalAlignment="Center" Text="{Binding Path=Description, UpdateSourceTrigger=PropertyChanged}" />
<hotkeys:HotkeyEditorControl Hotkey="{Binding Path=Hotkey, Mode=TwoWay}" Width="220"/>
</StackPanel>
</DataTemplate>
Expand All @@ -216,6 +216,16 @@
</StackPanel>
</ScrollViewer>
</TabItem>
<TabItem Header="About">
<ScrollViewer>
<StackPanel Orientation="Vertical" Margin="20">
<TextBlock FontWeight="Bold" FontSize="14" Margin="0 20">Amthyst Windows</TextBlock>
<TextBlock Text="{Binding Version}" />
<TextBlock Text="Author: Giuseppe Sorrentino" />
<TextBlock Text="Website: amethystwindows.com " />
</StackPanel>
</ScrollViewer>
</TabItem>
</TabControl>
</DockPanel>
</Grid>
Expand Down
20 changes: 20 additions & 0 deletions AmethystWindows/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
Expand Down Expand Up @@ -162,6 +168,7 @@ public class MainWindowViewModel : ObservableRecipient
private int _virtualDesktops;

private bool _disabled;
private string _version;

private List<Pair<string, string>> _configurableFilters;
private Pair<string, string> _selectedConfigurableFilter;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 856d3fa

Please sign in to comment.