1
0
Fork 0
mirror of https://github.com/hawkeye-stan/msfs-popout-panel-manager.git synced 2024-11-24 14:50:10 +00:00
msfs-popout-panel-manager/WpfApp/UserControlPanelSelection.xaml.cs
2022-07-23 15:23:32 -04:00

30 lines
1.2 KiB
C#

using MSFSPopoutPanelManager.WpfApp.ViewModel;
using System.Windows;
using System.Windows.Controls;
namespace MSFSPopoutPanelManager.WpfApp
{
public partial class UserControlPanelSelection : UserControl
{
private PanelSelectionViewModel _panelSelectionViewModel;
public UserControlPanelSelection(PanelSelectionViewModel panelSelectionViewModel)
{
InitializeComponent();
_panelSelectionViewModel = panelSelectionViewModel;
this.DataContext = panelSelectionViewModel;
panelSelectionViewModel.OpenTouchPanelBindingDialog += HandleOpenTouchPanelBindingDialog;
}
private void HandleOpenTouchPanelBindingDialog(object sender, System.EventArgs e)
{
TouchPanelBindingDialog dialog = new TouchPanelBindingDialog(_panelSelectionViewModel.TouchPanelBindingViewModel);
_panelSelectionViewModel.TouchPanelBindingViewModel.Initialize();
dialog.Owner = Application.Current.MainWindow;
dialog.Topmost = true;
dialog.WindowStartupLocation = WindowStartupLocation.CenterOwner;
dialog.ShowDialog();
}
}
}