1
0
Fork 0
mirror of https://github.com/hawkeye-stan/msfs-popout-panel-manager.git synced 2024-11-25 07:10:10 +00:00
msfs-popout-panel-manager/MainApp/AppUserControl/HelpDrawer.xaml.cs
2024-02-27 21:44:21 -05:00

28 lines
866 B
C#

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());
}
}
}