add resharper and hover effect for modules; change navigation bar

This commit is contained in:
Rene Schwarz
2021-08-10 02:03:11 +02:00
parent cdb86331e5
commit 910383775b
64 changed files with 792 additions and 832 deletions

View File

@@ -6,7 +6,9 @@ using System.Windows;
using System.Windows.Documents;
namespace Server_Dashboard {
public static class HyperlinkExtensions {
public static bool GetIsExternal(DependencyObject obj) {
return (bool)obj.GetValue(IsExternalProperty);
}
@@ -14,23 +16,25 @@ namespace Server_Dashboard {
public static void SetIsExternal(DependencyObject obj, bool value) {
obj.SetValue(IsExternalProperty, value);
}
public static readonly DependencyProperty IsExternalProperty =
DependencyProperty.RegisterAttached("IsExternal", typeof(bool), typeof(HyperlinkExtensions), new UIPropertyMetadata(false, OnIsExternalChanged));
private static void OnIsExternalChanged(object sender, DependencyPropertyChangedEventArgs args) {
var hyperlink = sender as Hyperlink;
if ((bool)args.NewValue)
hyperlink.RequestNavigate += Hyperlink_RequestNavigate;
else
if ((bool)args.NewValue) {
if (hyperlink != null)
hyperlink.RequestNavigate += Hyperlink_RequestNavigate;
} else if (hyperlink != null)
hyperlink.RequestNavigate -= Hyperlink_RequestNavigate;
}
private static void Hyperlink_RequestNavigate(object sender, System.Windows.Navigation.RequestNavigateEventArgs e) {
try {
Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri) { UseShellExecute = true });
} catch { }
} catch (Exception) { }
e.Handled = true;
}
}
}
}