wabbajack/Wabbajack/Views/MainWindow.xaml.cs

40 lines
1023 B
C#
Raw Normal View History

2019-10-07 17:33:34 +00:00
using Alphaleonis.Win32.Filesystem;
using System;
using System.ComponentModel;
2019-07-22 22:17:46 +00:00
using System.Threading;
using System.Windows;
using Wabbajack.Common;
using Wabbajack.Lib;
2019-09-27 04:07:54 +00:00
using Application = System.Windows.Application;
using MessageBox = System.Windows.MessageBox;
2019-07-22 22:17:46 +00:00
namespace Wabbajack
{
/// <summary>
2019-09-14 04:35:42 +00:00
/// Interaction logic for MainWindow.xaml
2019-07-22 22:17:46 +00:00
/// </summary>
public partial class MainWindow : Window
{
private MainWindowVM _mwvm;
2019-09-14 04:35:42 +00:00
2019-09-27 04:07:54 +00:00
public MainWindow(RunMode mode, string source)
2019-07-22 22:17:46 +00:00
{
InitializeComponent();
2019-07-26 20:59:14 +00:00
_mwvm = new MainWindowVM(mode, source, this);
Utils.Log($"Wabbajack Build - {ThisAssembly.Git.Sha}");
this.DataContext = _mwvm;
2019-07-22 22:17:46 +00:00
}
2019-09-27 04:07:54 +00:00
internal bool ExitWhenClosing = true;
private void Window_Closing(object sender, CancelEventArgs e)
{
_mwvm.Dispose();
2019-09-27 04:07:54 +00:00
if (ExitWhenClosing)
{
2019-09-27 04:07:54 +00:00
Application.Current.Shutdown();
}
}
2019-07-22 22:17:46 +00:00
}
2019-09-14 04:35:42 +00:00
}