dimanche 28 juin 2015

WPF dependency properties don't fire onChange on initialization

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

Aucun commentaire:

Enregistrer un commentaire