I have a control, which exposes a DP called PlacementTarget (it\'s bound to a child Popup FWIW).
What I want to do is if PlacementTarget is not set in XAML, then (
You don't need an extra placementTargetIsSet
field and hence no PropertyChangedCallback.
In order to find out if a value has been set for the PlacementTarget
property, you could just call the ReadLocalValue method and test if it returns DependencyProperty.UnsetValue:
bool placementTargetIsSet =
ReadLocalValue(PlacementTargetProperty) != DependencyProperty.UnsetValue;