Push Changes from Techcrafters Repo
This commit is contained in:
@@ -1,26 +1,32 @@
|
||||
using HMIToolkit;
|
||||
using MahApps.Metro.Controls;
|
||||
|
||||
namespace InfineonHMI
|
||||
namespace InfineonHMI;
|
||||
|
||||
/// <summary>
|
||||
/// Interaction logic for MainWindow.xaml
|
||||
/// </summary>
|
||||
public partial class MainWindow
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for MainWindow.xaml
|
||||
/// </summary>
|
||||
public partial class MainWindow
|
||||
{
|
||||
|
||||
|
||||
public MainWindow(MainWindowVM mainWindowVM)
|
||||
{
|
||||
this.DataContext = mainWindowVM;
|
||||
InitializeComponent();
|
||||
Closed += OnClosedEvent;
|
||||
}
|
||||
public MainWindow(MainWindowVM mainWindowVM)
|
||||
{
|
||||
DataContext = mainWindowVM;
|
||||
InitializeComponent();
|
||||
Loaded += MainWindowLoaded;
|
||||
Closed += OnClosedEvent;
|
||||
}
|
||||
|
||||
private void OnClosedEvent(object? sender, EventArgs e)
|
||||
{
|
||||
if (DataContext is IDisposable dataContext)
|
||||
dataContext.Dispose();
|
||||
}
|
||||
}
|
||||
private void MainWindowLoaded(object sender, System.Windows.RoutedEventArgs e)
|
||||
{
|
||||
var model = (MainWindowVM)DataContext;
|
||||
model.ChangeUserClicked();
|
||||
}
|
||||
|
||||
private void OnClosedEvent(object? sender, EventArgs e)
|
||||
{
|
||||
if (DataContext is IDisposable dataContext)
|
||||
dataContext.Dispose();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user