WPF dependency properties don't fire onChange on initialization

391 Views Asked by At

I use dependency properties and rely on PropertyValueChange handlers during initialization.

However, PropertyValueChange events don't fire upon initialization of default values of their properties, only on further changes. So I have to manually fire PropertyValueChange to force other components to pickup the first (default) property value.

Am I understand default dependency property default values incorrectly?

Is there any better way to initialize? I can't use static configuration in XAML for everything. I have some logic parts which rely on PropertyValueChange but can't by their nature be initialized from XAML.

thanks

0

There are 0 best solutions below