提交 63da0180 编写于 作者: M Martin Zikmund

fix: GetParentInternal should use VisualTreeHelper to get non-public parents too

上级 3fa9f56c
......@@ -7,6 +7,7 @@
using Uno.UI.Xaml.Core;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
namespace Uno.UI.Extensions
{
......@@ -22,7 +23,7 @@ namespace Uno.UI.Extensions
internal static DependencyObject? GetParentInternal(this DependencyObject dependencyObject, bool publicParentOnly = true)
{
//TODO Uno: Currently we return any parent, regardless of its "publicness".
return dependencyObject.GetParent() as DependencyObject;
return VisualTreeHelper.GetParent(dependencyObject);
// If the parent is for the inheritance context only the m_pParent field is being repurposed to store
// a weakref and is invalid.
// If we're asking for the public parent we don't return a parent if it's marked nonpublic
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册