1
0
mirror of synced 2024-11-15 01:33:51 +00:00
PettingZoo/View/MainWindow.xaml.cs

28 lines
680 B
C#
Raw Normal View History

using System;
using System.Windows;
2016-06-18 14:50:32 +00:00
using PettingZoo.ViewModel;
namespace PettingZoo.View
{
public partial class MainWindow
2016-06-18 14:50:32 +00:00
{
2016-06-18 18:30:12 +00:00
public MainWindow(MainViewModel viewModel)
2016-06-18 14:50:32 +00:00
{
2016-06-18 18:30:12 +00:00
WindowStartupLocation = WindowStartupLocation.CenterScreen;
2016-06-18 14:50:32 +00:00
InitializeComponent();
DataContext = viewModel;
Dispatcher.ShutdownStarted += OnDispatcherShutDownStarted;
}
private void OnDispatcherShutDownStarted(object sender, EventArgs e)
{
var disposable = DataContext as IDisposable;
if (!ReferenceEquals(null, disposable))
disposable.Dispose();
2016-06-18 14:50:32 +00:00
}
}
}