删除时得到通知的视觉/逻辑子添加/ [英] Be notified when visual/logical child added/removed

查看:131
本文介绍了删除时得到通知的视觉/逻辑子添加/的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在寻找一种方式被通知当一个孩子被添加到视觉或逻辑儿童。

I am currently looking for a way to be notified when a child is added to the visual or logical children.

我知道的视觉:: OnVisualChildrenChanged方法,但它并不适用于我,因为我不能永远继承和覆盖此函数。我在找一个事件。

I am aware of the Visual::OnVisualChildrenChanged method, but it does not apply to me since I can't always inherit and override this function. I am looking for an event.

那么,有没有一种方法,以FrameworkElement上/视频的拥有者,当一个孩子被添加到被通知?

So, is there a way for the owner of a FrameworkElement/Visual to be notified when a child is added?

推荐答案

是不是更容易扩展

System.Windows.Controls.UIElementCollection 

做了通报,并使用

to do the notification and use

protected override UIElementCollection CreateUIElementCollection(FrameworkElement logicalParent)

这篇关于删除时得到通知的视觉/逻辑子添加/的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆