47 lines
1.2 KiB
C#
47 lines
1.2 KiB
C#
using AciTester.ViewModels;
|
|
using CommunityToolkit.Mvvm.Input;
|
|
using System.Text;
|
|
using System.Windows;
|
|
using System.Windows.Controls;
|
|
using System.Windows.Data;
|
|
using System.Windows.Documents;
|
|
using System.Windows.Input;
|
|
using System.Windows.Media;
|
|
using System.Windows.Media.Imaging;
|
|
using System.Windows.Navigation;
|
|
using System.Windows.Shapes;
|
|
|
|
namespace AciTester.Views
|
|
{
|
|
/// <summary>
|
|
/// Interaction logic for MainWindow.xaml
|
|
/// </summary>
|
|
public partial class MainWindow : Window
|
|
{
|
|
public MainWindow()
|
|
{
|
|
InitializeComponent();
|
|
|
|
this.Loaded += (s, e) =>
|
|
{
|
|
var keyGesture = new KeyGesture(Key.P, ModifierKeys.Control);
|
|
var inputBinding = new InputBinding(
|
|
new RelayCommand(OpenConfigWindow),
|
|
keyGesture);
|
|
this.InputBindings.Add(inputBinding);
|
|
};
|
|
}
|
|
|
|
private void OpenConfigWindow()
|
|
{
|
|
var vm = (MainViewModel)this.DataContext;
|
|
var configVm = new ConfigViewModel(vm._plcService, vm._config, vm.Calibration);
|
|
var win = new ConfigWindow { DataContext = configVm, Owner = this };
|
|
win.ShowDialog();
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
} |