Query:
Customer is trying to get to implement the module
https://github.com/appcelerator-modules/ti.xaml.listview in Ti Windows project, where there happens to be multiple ListViews in different screens. Each ListView obviously has its own UI appearance (so they have defined several templates for each ListItems).
So we're kind of figuring out how would we 'translate' these templates to this module. The thing is that judging by its documentation and this
https://github.com/appcelerator-modules/ti.xaml.listview/blob/master/windows/include/TiXamlListView.hpp#L73-L75 it would appear that you can only have one template definition in a single project.
So the question here is: Given a project with:
Screen 1 - Contains ListView1
Screen 2 - Contains ListView2
Screen 3 - Contains ListView3
Screen N - Contains ListViewN
And each ListView's ListItems look different by design -
How can we style all of this ListVIews' items with the given module implementation?
In order to use multiple styles in the project, use
defaultItemTemplate
property. It searches for the template with the given key in the<DataTemplate>>
and apply the style, that way you can use multiple styles in one project. Here's an example:In this case, the code
defaultItemTemplate: 'itemTemplate2'
searches for<DataTemplate x:Key=itemTemplate2>
data template in the style xml. For instance check out the template below.Thanks a lot. Will inform user now.
I think this can be closed for now. Feel free to reopen if that's not the case.
[~kiguchi], Many thanks for your help here!