We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aa9c903 commit 065cab2Copy full SHA for 065cab2
src/WPFDevelopers.Shared/Core/Helpers/ControlsHelper.cs
@@ -142,6 +142,17 @@ public static T FindVisualChild<T>(DependencyObject parent) where T : Dependency
142
return null;
143
}
144
145
+ public static T FindParent<T>(DependencyObject child) where T : DependencyObject
146
+ {
147
+ var parent = VisualTreeHelper.GetParent(child);
148
+ if (parent == null) return null;
149
+
150
+ if (parent is T tParent)
151
+ return tParent;
152
153
+ return FindParent<T>(parent);
154
+ }
155
156
public static object GetXmlReader(object Content)
157
{
158
try
0 commit comments