Skip to content

Commit

Permalink
close main window on ESC too
Browse files Browse the repository at this point in the history
  • Loading branch information
pschichtel committed Oct 25, 2020
1 parent 4b41c79 commit 5d3b459
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
8 changes: 8 additions & 0 deletions GUI/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@
Height="450"
Width="800"
MinWidth="200">

<Window.InputBindings>
<KeyBinding Command="ApplicationCommands.Close" Key="Escape" />
</Window.InputBindings>

<Window.CommandBindings>
<CommandBinding Command="ApplicationCommands.Close" Executed="CloseCommandBinding_Executed" />
</Window.CommandBindings>

<local:FaxList />
</Window>
6 changes: 6 additions & 0 deletions GUI/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Drawing;
using System.Windows;
using System.Windows.Forms;
using System.Windows.Input;
using Application = System.Windows.Application;

namespace SipGateVirtualFaxGui
Expand Down Expand Up @@ -32,6 +33,11 @@ public MainWindow()
InitializeComponent();
}

private void CloseCommandBinding_Executed(object sender, ExecutedRoutedEventArgs e)
{
Hide();
}

private NotifyIcon SetupIcon(Icon icon)
{
var exit = new MenuItem()
Expand Down

0 comments on commit 5d3b459

Please sign in to comment.