Silverlight: How to receive notification of a change in an inherited DependencyProperty

前端 未结 5 1573
无人共我
无人共我 2020-12-24 08:53

I have a control which inherits from (you guessed it) Control. I want to receive a notification whenever the FontSize or Style properties are chang

5条回答
  •  没有蜡笔的小新
    2020-12-24 09:49

    You cannot externally listen to dependency property changed notifications.

    You can access the Dependency Property Metadata with the following line of code:

    PropertyMetadata metaData = Control.ActualHeightProperty.GetMetadata(typeof(Control));
    

    However, the only public member that is exposed is "DefaultValue".

    There are a multitude of ways to do this in WPF. But they are currently not supported by Silverlight 2 or 3.

提交回复
热议问题