2026-05-15 20:39:11 +08:00
|
|
|
|
using ASTM_D7896_Tester.Views;
|
|
|
|
|
|
using CommunityToolkit.Mvvm.Input;
|
2026-04-18 19:00:34 +08:00
|
|
|
|
using System.Windows;
|
|
|
|
|
|
using System.Windows.Input;
|
|
|
|
|
|
|
2026-05-15 20:39:11 +08:00
|
|
|
|
namespace ASTM_D7896_Tester.Views;
|
|
|
|
|
|
|
|
|
|
|
|
public partial class MainWindow : Window
|
2026-04-18 19:00:34 +08:00
|
|
|
|
{
|
2026-05-15 20:39:11 +08:00
|
|
|
|
public MainWindow()
|
|
|
|
|
|
{
|
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
// 注册快捷键
|
|
|
|
|
|
KeyGesture keyGesture = new KeyGesture(Key.P, ModifierKeys.Control);
|
|
|
|
|
|
var inputBinding = new InputBinding(OpenConfigCommand, keyGesture);
|
|
|
|
|
|
this.InputBindings.Add(inputBinding);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private ICommand _openConfigCommand;
|
|
|
|
|
|
public ICommand OpenConfigCommand => _openConfigCommand ??= new RelayCommand(OpenConfig);
|
|
|
|
|
|
|
|
|
|
|
|
private void OpenConfig()
|
2026-04-18 19:00:34 +08:00
|
|
|
|
{
|
2026-05-15 20:39:11 +08:00
|
|
|
|
var configWindow = new ConfigWindow();
|
|
|
|
|
|
configWindow.Owner = this;
|
|
|
|
|
|
configWindow.ShowDialog();
|
2026-04-18 19:00:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|