|
|
@ -1,4 +1,5 @@
|
|
|
|
using STranslate.Utils;
|
|
|
|
using STranslate.Utils;
|
|
|
|
|
|
|
|
using STranslate.ViewModel;
|
|
|
|
using System;
|
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Linq;
|
|
|
|
using System.Linq;
|
|
|
@ -58,6 +59,7 @@ namespace STranslate
|
|
|
|
public MainWindow()
|
|
|
|
public MainWindow()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
InitializeComponent();
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
|
|
this.DataContext = MainVM.Instance;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
@ -81,8 +83,8 @@ namespace STranslate
|
|
|
|
if (e.Key == Key.Escape)
|
|
|
|
if (e.Key == Key.Escape)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
this.Hide();
|
|
|
|
this.Hide();
|
|
|
|
this.TextBoxInput.Text = string.Empty;
|
|
|
|
MainVM.Instance.InputTxt = string.Empty;
|
|
|
|
this.TextBoxOutput.Text = string.Empty;
|
|
|
|
MainVM.Instance.OutputTxt = string.Empty;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//退出 Ctrl+Q
|
|
|
|
//退出 Ctrl+Q
|
|
|
|
if (e.KeyboardDevice.Modifiers.HasFlag(ModifierKeys.Control) && e.Key == Key.Q)
|
|
|
|
if (e.KeyboardDevice.Modifiers.HasFlag(ModifierKeys.Control) && e.Key == Key.Q)
|
|
|
@ -138,9 +140,9 @@ namespace STranslate
|
|
|
|
/// <param name="e"></param>
|
|
|
|
/// <param name="e"></param>
|
|
|
|
private void Window_Deactivated(object sender, EventArgs e)
|
|
|
|
private void Window_Deactivated(object sender, EventArgs e)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//this.Hide();
|
|
|
|
this.Hide();
|
|
|
|
//this.TextBoxInput.Text = string.Empty;
|
|
|
|
MainVM.Instance.InputTxt = string.Empty;
|
|
|
|
//this.TextBoxOutput.Text = string.Empty;
|
|
|
|
MainVM.Instance.OutputTxt = string.Empty;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|