From 674ca83ba9243a9e95a7568c797668dab6aee26a Mon Sep 17 00:00:00 2001 From: Lucas Faria Mendes Date: Mon, 30 Mar 2026 10:35:25 -0300 Subject: feat: upload files --- .../Gestor.Common.Helpers/FindVisualChild.cs | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Gestor.Common/Gestor.Common.Helpers/FindVisualChild.cs (limited to 'Gestor.Common/Gestor.Common.Helpers/FindVisualChild.cs') diff --git a/Gestor.Common/Gestor.Common.Helpers/FindVisualChild.cs b/Gestor.Common/Gestor.Common.Helpers/FindVisualChild.cs new file mode 100644 index 0000000..4cabf7c --- /dev/null +++ b/Gestor.Common/Gestor.Common.Helpers/FindVisualChild.cs @@ -0,0 +1,32 @@ +using System; +using System.Windows; +using System.Windows.Media; + +namespace Gestor.Common.Helpers +{ + public class FindVisualChild + { + public FindVisualChild() + { + } + + public static childItem Find(DependencyObject obj) + where childItem : DependencyObject + { + for (int i = 0; i < VisualTreeHelper.GetChildrenCount(obj); i++) + { + DependencyObject child = VisualTreeHelper.GetChild(obj, i); + if (child != null && child is childItem) + { + return (childItem)child; + } + childItem _childItem = FindVisualChild.Find(child); + if (_childItem != null) + { + return _childItem; + } + } + return default(childItem); + } + } +} \ No newline at end of file -- cgit v1.2.3