Skip to content

Commit

Permalink
Fix #119: Can't click HyperLink inside NavigationView
Browse files Browse the repository at this point in the history
  • Loading branch information
Kinnara committed Jun 19, 2020
1 parent bcd62c2 commit 3cba5e7
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Windows;
using System.Windows.Controls.Primitives;
using System.Windows.Media;
using System.Windows.Media.Media3D;

namespace ModernWpf.Controls
{
Expand All @@ -16,7 +17,17 @@ public static Rect GetLayoutSlot(FrameworkElement element)

public static DependencyObject GetParent(DependencyObject element)
{
return VisualTreeHelper.GetParent(element);
if (element is Visual || element is Visual3D)
{
return VisualTreeHelper.GetParent(element);
}

if (element is FrameworkContentElement fce)
{
return fce.Parent;
}

return null;
}
}
}

0 comments on commit 3cba5e7

Please sign in to comment.