Project Maintenance

This commit is contained in:
Gustave Monce
2021-08-09 20:21:09 +02:00
parent 9865ef7f79
commit 847ce0506d
411 changed files with 5922 additions and 54941 deletions
+8 -3
View File
@@ -36,21 +36,26 @@ namespace WPinternals
private void HandleHyperlinkClick(object sender, RoutedEventArgs args)
{
Hyperlink link = args.Source as Hyperlink;
if (link != null)
if (args.Source is Hyperlink link)
{
if (link.NavigateUri.ToString() == "Flash")
{
((FlashResourcesViewModel)DataContext).SwitchToFlashRom();
}
else if (link.NavigateUri.ToString() == "Download")
{
((FlashResourcesViewModel)DataContext).SwitchToDownload();
}
else
{
System.Diagnostics.Process.Start(link.NavigateUri.ToString());
}
}
}
private void Document_Loaded(object sender, RoutedEventArgs e)
{
(sender as FlowDocument).AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
(sender as FlowDocument)?.AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
}
}
}