From 08d737db2f79b7c0e2703d254f4b3fbf93884a0b Mon Sep 17 00:00:00 2001 From: Victor Date: Tue, 28 Jan 2020 02:35:15 +0000 Subject: [PATCH] Rework notification windows --- .../Services/NotificationService.cs | 6 ++---- .../Bindings/NotificationWindowViewModel.cs | 19 ------------------- source/SylphyHorn/UI/PinWindow.xaml | 11 +++-------- source/SylphyHorn/UI/SwitchWindow.xaml | 11 +++-------- 4 files changed, 8 insertions(+), 39 deletions(-) diff --git a/source/SylphyHorn/Services/NotificationService.cs b/source/SylphyHorn/Services/NotificationService.cs index 2a58ba8..d3bab32 100644 --- a/source/SylphyHorn/Services/NotificationService.cs +++ b/source/SylphyHorn/Services/NotificationService.cs @@ -50,8 +50,7 @@ private static IDisposable ShowDesktopWindow(int index) var vmodel = new NotificationWindowViewModel { Title = ProductInfo.Title, - Header = "Virtual Desktop Switched", - Body = "Current Desktop: Desktop " + index, + Body = $"Desktop {index}", }; var source = new CancellationTokenSource(); @@ -94,8 +93,7 @@ private static IDisposable ShowPinWindow(IntPtr hWnd, PinOperations operation) var vmodel = new NotificationWindowViewModel { Title = ProductInfo.Title, - Header = "Virtual Desktop", - Body = $"{(operation.HasFlag(PinOperations.Pin) ? "Pinned" : "Unpinned")} this {(operation.HasFlag(PinOperations.Window) ? "window" : "application")}", + Body = $"{(operation.HasFlag(PinOperations.Window) ? "Window" : "Application")} {(operation.HasFlag(PinOperations.Pin) ? "Pinned" : "Unpinned")}", }; var source = new CancellationTokenSource(); var window = new PinWindow(hWnd) diff --git a/source/SylphyHorn/UI/Bindings/NotificationWindowViewModel.cs b/source/SylphyHorn/UI/Bindings/NotificationWindowViewModel.cs index 34d9c6a..8f2e948 100644 --- a/source/SylphyHorn/UI/Bindings/NotificationWindowViewModel.cs +++ b/source/SylphyHorn/UI/Bindings/NotificationWindowViewModel.cs @@ -4,25 +4,6 @@ namespace SylphyHorn.UI.Bindings { public class NotificationWindowViewModel : WindowViewModel { - #region Header 変更通知プロパティ - - private string _Header; - - public string Header - { - get { return this._Header; } - set - { - if (this._Header != value) - { - this._Header = value; - this.RaisePropertyChanged(); - } - } - } - - #endregion - #region Body 変更通知プロパティ private string _Body; diff --git a/source/SylphyHorn/UI/PinWindow.xaml b/source/SylphyHorn/UI/PinWindow.xaml index 739be89..2d93b6e 100644 --- a/source/SylphyHorn/UI/PinWindow.xaml +++ b/source/SylphyHorn/UI/PinWindow.xaml @@ -13,7 +13,7 @@ mc:Ignorable="d" d:DataContext="{d:DesignInstance bindings:NotificationWindowViewModel}" Title="{Binding Title}" - Width="400" + Width="355.462" Height="100" ResizeMode="NoResize" WindowStartupLocation="CenterScreen" @@ -67,14 +67,9 @@ - - + FontSize="32" HorizontalAlignment="Center" /> diff --git a/source/SylphyHorn/UI/SwitchWindow.xaml b/source/SylphyHorn/UI/SwitchWindow.xaml index a2f7910..e50de09 100644 --- a/source/SylphyHorn/UI/SwitchWindow.xaml +++ b/source/SylphyHorn/UI/SwitchWindow.xaml @@ -13,7 +13,7 @@ mc:Ignorable="d" d:DataContext="{d:DesignInstance bindings:NotificationWindowViewModel}" Title="{Binding Title}" - Width="500" + Width="211.476" Height="100" ResizeMode="NoResize" Topmost="True" @@ -66,14 +66,9 @@ - - + FontSize="32" HorizontalAlignment="Center" />