32 lines
649 B
C#
32 lines
649 B
C#
using HMIToolkit;
|
|
using MahApps.Metro.Controls;
|
|
|
|
namespace InfineonHMI;
|
|
|
|
/// <summary>
|
|
/// Interaction logic for MainWindow.xaml
|
|
/// </summary>
|
|
public partial class MainWindow
|
|
{
|
|
|
|
|
|
public MainWindow(MainWindowVM mainWindowVM)
|
|
{
|
|
DataContext = mainWindowVM;
|
|
InitializeComponent();
|
|
Loaded += MainWindowLoaded;
|
|
Closed += OnClosedEvent;
|
|
}
|
|
|
|
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();
|
|
}
|
|
} |