/// <summary>
/// 从当前控件开始,查找指定类型名的控件
/// </summary>
/// <param name="obj"></param>
/// <param name="systemTypeName"></param>
/// <returns></returns>
private object FindControl(DependencyObject obj , string systemTypeName)
{
if (obj.DependencyObjectType.SystemType.Name == systemTypeName)
{
return obj;
}
return FindControl(VisualTreeHelper.GetParent(obj) , systemTypeName);
}
在WPF查询控件,包括自定义控件
最新推荐文章于 2024-07-15 08:00:00 发布