wpf 查找children的方法

var newValue = (bool)args.NewValue;
HZWaitLoadingEx source = (HZWaitLoadingEx)sender;
ControlTemplate ct = source.Template;
ContentPresenter busycontent = ct.FindName("busycontent", source) as ContentPresenter;
busycontent.Visibility = newValue ? Visibility.Visible : Visibility.Collapsed;

原文地址:https://www.cnblogs.com/zsx-blog/p/8328921.html