1
0
Fork 0
mirror of https://github.com/hawkeye-stan/msfs-popout-panel-manager.git synced 2024-11-22 05:40:11 +00:00
msfs-popout-panel-manager/MainApp/AppUserControl/PreferenceDrawer.xaml.cs
2024-03-03 22:10:13 -05:00

26 lines
No EOL
727 B
C#

using Microsoft.Extensions.DependencyInjection;
using MSFSPopoutPanelManager.MainApp.ViewModel;
using System.ComponentModel;
using System.Windows;
namespace MSFSPopoutPanelManager.MainApp.AppUserControl
{
public partial class PreferenceDrawer
{
public PreferenceDrawer()
{
if (DesignerProperties.GetIsInDesignMode(new DependencyObject()))
{
InitializeComponent();
return;
}
var viewModel = App.AppHost.Services.GetRequiredService<PreferenceDrawerViewModel>();
Loaded += (_, _) =>
{
DataContext = viewModel;
InitializeComponent();
};
}
}
}