I have a WP7 app that gets data from a DataContext. Say that I have a
class Country {
String country_name;
int population;
int density;
...
}
class City {
String name;
Country country;
}
I need to have, in databinding, the members of the Country class starting from City class.
If I make{Binding name}
, I get the city name. How can I get Country properties? If I try {Binding country.country_name}
, it does not work.
Ho开发者_如何学编程w can I solve it?Are you sure that doesn't work? It should. Are your classes implementing the INotifyPropertyChanged interface? If not, maybe the value is not set at the moment of the binding and without the notification the binding is never refreshed.
精彩评论