Skip to content
This repository was archived by the owner on Sep 11, 2023. It is now read-only.

Commit 7fa3efc

Browse files
committed
escape button imitates cancel button in templates window
1 parent 3ac612e commit 7fa3efc

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

UI/Windows/NewFileWindow.xaml.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,11 @@
99
using System.Windows.Input;
1010
using System.Windows.Media;
1111
using System.Xml;
12-
using System.Xml.Linq;
1312
using MahApps.Metro;
1413
using MahApps.Metro.Controls.Dialogs;
1514
using Microsoft.Win32;
16-
using SPCode.UI.Components;
1715
using SPCode.Utils;
16+
using Xceed.Wpf.AvalonDock.Layout;
1817

1918
namespace SPCode.UI.Windows
2019
{
@@ -100,7 +99,7 @@ public NewFileWindow()
10099
InitializeComponent();
101100
ParseTemplateFile();
102101
Language_Translate();
103-
PreviewBox.Parent = new Xceed.Wpf.AvalonDock.Layout.LayoutDocument();
102+
PreviewBox.Parent = new LayoutDocument();
104103
Program.MainWindow.EditorsReferences.Add(PreviewBox);
105104
if (Program.OptionsObject.Program_AccentColor != "Red" || Program.OptionsObject.Program_Theme != "BaseDark")
106105
{
@@ -257,7 +256,7 @@ private void NewFileWind_KeyDown(object sender, KeyEventArgs e)
257256
{
258257
if (e.Key == Key.Escape)
259258
{
260-
Close();
259+
CancelButton_Click(null, null);
261260
}
262261
}
263262

0 commit comments

Comments
 (0)