Add ItemsControl support
wieslawsoltes opened this issue ยท 11 comments
<ItemsControl Items="{Binding Values}">
<ItemsControl.DataTemplates>
<DataTemplate DataType="Namespace:Type">
<Grid>
<TextBox Text="{Binding Content}"/>
</Grid>
</DataTemplate>
</ItemsControl.DataTemplates>
</ItemsControl>
The lack of ItemsControl
in Xamarin is a pile of grief!
This is like an ASP.net Repeater, isn't it?
Could even be considered as a lookless control if the DataTemplate stays empty (eg when you want an invisible component [or visible in design-mode only if you prefer] to hold a list of objects like one is accustomed to doing in Delphi-style RAD)
for reference, https://msdn.microsoft.com/en-us/library/system.windows.controls.itemscontrol(v=vs.110).aspx is what @wieslawsoltes is referring to.
Problem with the XAML Standard is that it promotes an xml vocabulary approach with a flat / no inheritance - no object model approach. So controls like this one which are usually used as ancestors (but not only), need some use cases probably, since one could argue they could re-template a list or other control instead.
btw, how about virtualization support? is it considered in such a control? If it uses a single datatemplate for items, couldn't a pool of such template object instances be reused during scrolling? And I don't mean having the control itself support scrolling, but work together with virtualizing scrolling containers nicely
@birbilis i don't believe we've stated one way or the other if XAML standard is or is not a vocabulary only approach. Right now i only believe there is an ask for supported items asking for a matching object model, not one asking for vocab only. With that said, if you want vocab only, please create a new issue as this topic.
I think virtualization is another great item to be discussed but maybe in a different topic and cross reference this :)
@crutkas that's what I've gotten so far from the draft, the discussions etc. Obviously the community expects more, that's why several issues exist mentioning interfaces, code-behind etc. Thought MS had decided on that already. If you're still open to standardizing on an object model (ideally one defined using interfaces and inheritance), that's good news I guess
Regarding virtualization, I think there was an issue on list control that already mentions it. The question is whether ItemsControl should be virtualization-aware or not. I think it could be, but probably virtualization interfaces should be standardized then (as long as we're not just defining controls here but also UI/component services) for reuse among virtualization-aware controls. But as I already mentioned, I had come to the conclusion (probably the draft doc and the Build panel video also helped towards it) that it was out of scope of this effort. If not, I guess I could add issues on Drag&Drop etc.
Insurance?
@birbilis don't assume something is out of scope. If you don't fight for something you feel is important, opinions can't be changed. Clearly say you do and positioning for it in the appropriate issue.
"We will get Repeater in fall creater update in UWP. It is more general than RecyclerView"
Mentioned at "Add RecyclerView" issue, maybe relevant
Judging from the sample XAML provided, the DataTemplate issue is probably related #187
@crutkas the repo description says "Vocabulary specification for the XAML Standard, a unified markup dialect for defining user interface elements and their behavior." and then there's a longer description saying same thing. Hope eventually that will be updated as well, should the scope be expanded to an object model (hope via interfaces) as many wish to