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

Commit

Permalink
Rework notification windows
Browse files Browse the repository at this point in the history
  • Loading branch information
ViRb3 committed Jan 28, 2020
1 parent 785378e commit 08d737d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 39 deletions.
6 changes: 2 additions & 4 deletions source/SylphyHorn/Services/NotificationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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)
Expand Down
19 changes: 0 additions & 19 deletions source/SylphyHorn/UI/Bindings/NotificationWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
11 changes: 3 additions & 8 deletions source/SylphyHorn/UI/PinWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -67,14 +67,9 @@

<DockPanel VerticalAlignment="Center"
Margin="16,12">
<TextBlock DockPanel.Dock="Top"
Text="{Binding Header}"
FontFamily="Segoe UI Light, Meiryo UI"
FontSize="18"
Margin="2,0,0,-4" />
<TextBlock DockPanel.Dock="Top"
<TextBlock DockPanel.Dock="Top"
Text="{Binding Body}"
FontFamily="Segoe UI Light, Meiryo UI"
FontSize="32" />
FontSize="32" HorizontalAlignment="Center" />
</DockPanel>
</ui:NotificationWindow>
11 changes: 3 additions & 8 deletions source/SylphyHorn/UI/SwitchWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -66,14 +66,9 @@

<DockPanel VerticalAlignment="Center"
Margin="16,12">
<TextBlock DockPanel.Dock="Top"
Text="{Binding Header}"
FontFamily="Segoe UI Light, Meiryo UI"
FontSize="18"
Margin="2,0,0,-4" />
<TextBlock DockPanel.Dock="Top"
<TextBlock DockPanel.Dock="Top"
Text="{Binding Body}"
FontFamily="Segoe UI Light, Meiryo UI"
FontSize="32" />
FontSize="32" HorizontalAlignment="Center" />
</DockPanel>
</ui:NotificationWindow>

0 comments on commit 08d737d

Please sign in to comment.