public MainWindow() { InitializeComponent(); this.Closing += MainWindow_Closing; DataContext = App.mainvm; }