如何监听子元素的属性变化呢?
我有一个自定义类,其中有子元素RichTextBox,这个RichTextBox不知道在什么情况下改变了FontSize,我如何监听呢?
![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
1 Text.FontSize = 72; 2 DependencyPropertyDescriptor descriptor=DependencyPropertyDescriptor.FromProperty(FontSizeProperty,typeof(RichTextBox)); 3 descriptor.AddValueChanged(Text, (s, e) => 4 { 5 Debug.WriteLine("FontSizeChanged"); 6 });