#162 – UIPropertyMetadata and FrameworkPropertyMetadata
December 21, 2010 Leave a comment
Some dependency properties in WPF have metadata deriving from UIPropertyMetadata or FrameworkPropertyMetadata, rather than from PropertyMetadata.
For example, the ComboBox.IsEnabledProperty, which is defined in UIElement has metadata of type UIPropertyMetadata.
UIPropertyMetadata meta = (UIPropertyMetadata)ComboBox.IsEnabledProperty.GetMetadata(cboTest);
UIPropertyMetadata derives from PropertyMetadata and adds the IsAnimationProhibited property.
The Button.IsEnabledProperty has metadata of type FrameworkPropertyMetadata.
FrameworkPropertyMetadata meta = (FrameworkPropertyMetadata)Button.IsEnabledProperty.GetMetadata(btnTest);
FrameworkPropertyMetadata derives from UIPropertyMetadata and adds properties related to layout.