It's pretty easy to inherit from an existing control in WPF.
For instance, this great programmer I know has written an extended combobox. It has extra functionality, like:
* Automatically select the value if only one item is available in the items source;
* Disable the control when no items are in the items source;
So, there's logic in the inherited class that manages the IsEnabled property.
Flexibility must remain, so consumers of this control should still be able to set the IsEnabled property, and overrule the default logic.
Here's a way to programmatically check if the property has been set:
if (DependencyPropertyHelper.GetValueSource(this, ComboBox.IsEnabledProperty).BaseValueSource == BaseValueSource.Default)
{
IsEnabled = !(IsDisabledWhenItemsSourceIsEmpty && (_customItemsSource.Count == 0));
}
More info