继续调整订单样式

This commit is contained in:
wule committed 2026-06-22 21:54:08 +08:00
1 parent 031fa8cfe6
commit a005946410
13 files changed
+1166 -326

No files matched your search

+19
View File
@@ -66,5 +66,24 @@ namespace _29WxOrderWpf.Utils
}
return null;
}
public static List<T> FindVisualChildAll<T>(DependencyObject obj, string xName) where T : DependencyObject
{
List<T> list= new List<T>();
for (int i = 0; i < VisualTreeHelper.GetChildrenCount(obj); i++)
{
DependencyObject child = VisualTreeHelper.GetChild(obj, i);
string controlName = child?.GetValue(Control.NameProperty) as string;
if (controlName == xName)
{
list.Add((T)child);
}
else
{
list.AddRange(FindVisualChildAll<T>(child, xName));
}
}
return list;
}
}
}