Question

I have a silverlight user control with three dependency properties. All properties are bound successfully and they have correct values. Values for these properties are loaded asynchronously in parent control so I don't know the sequence of my properties' binding. I need to load some entities when all properties of my control have been loaded. Is there any elegant solution to solve this issue. I don't want to use a hack creating a private field or something like it. Load event is fired before all bindings, because as I said my properties load asynchronously.

Here is an example:

<namespace:MyControl Prop1="{Binding ParentProp1}" Prop2="{Binding ParentProp2}" Prop3="{Binding ParentProp3}" />

No correct solution

OTHER TIPS

Create your own event and call it when all your properties are initialized.
You can determine that all your properties are correctly initialized by implementing INotifyPropertyChanged in your control and then subscribing to the OnPropertyChanged event and checking that all properties are initialized. There you can fire your event to tell any subscriber that initialization was finished.

Implement INotifyPropertyChanged
C# Events Guidelines

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top