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/HelpDrawer.xaml.cs

29 lines
866 B
C#
Raw Normal View History

2024-02-28 02:44:21 +00:00
using System.ComponentModel;
using System.Windows;
using System.Windows.Navigation;
using Microsoft.Extensions.DependencyInjection;
using MSFSPopoutPanelManager.MainApp.ViewModel;
namespace MSFSPopoutPanelManager.MainApp.AppUserControl
{
public partial class HelpDrawer
{
private readonly HelpViewModel _viewModel;
public HelpDrawer()
{
InitializeComponent();
if (DesignerProperties.GetIsInDesignMode(new DependencyObject()))
return;
_viewModel = App.AppHost.Services.GetRequiredService<HelpViewModel>();
Loaded += (_, _) => { DataContext = _viewModel; };
}
private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e)
{
_viewModel.HyperLinkCommand.Execute(e.Uri.ToString());
}
}
}