MainWindow.xaml.cs
642 Bytes
using HHECS.RobotTool.ViewModel;
using Microsoft.Extensions.DependencyInjection;
using System.ComponentModel;
using System.Windows;
namespace RobotTool
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
var vm = App.Current.Services.GetService<MainVM>()!;
vm.Owner = this;
DataContext = vm;
}
protected override void OnClosing(CancelEventArgs e)
{
this.Hide();
e.Cancel = true;
}
}
}