Hi everyone.
I stuck with a problem of displaying list of items without using ListView.
I have a ListView with ItemSource property bound to ObservableCollection of Company objects. Each of that company has a list of phone numbers. The number of phone numbers may vary from 1 to 5. Now I need to show all phone numbers of each company within ListView's ItemTemplate as a list of labels inside StackLayout. I tried to bind Children property of StackLayout to a list of generated Labels through a custom converter in the XAML, but found that Children property is not bindable.
I couldn't figure out how to achieve desired result using code either, because at the moment of ListView generation the list of companies is not yet ready.
I guess I can subscribe to the event of the view model which fetches the list of companies and render ListView when the appropriate property is set, and before that show other page with activity indicator. But that doesn't seem like a good approach for me. Besides that I'd like to use XAML as much as possible.
Thanks in advance.
↧
Display list of items without using ListView
↧