Replies: 5 comments
-
While there are components that don't have UI, they might have platform-specific physics. Using those components, I would expect them to respect the platform rules. |
Beta Was this translation helpful? Give feedback.
-
Even components don't have UI look or platform specific behavior. there is no guarantee they will remain like that. |
Beta Was this translation helpful? Give feedback.
-
BindableLayout is not the solution to this? https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/layouts/bindable-layouts |
Beta Was this translation helpful? Give feedback.
-
I love this proposal! @dhindrik I see BindableLayout as a stopgap solution to bolt some of the new features from CollectionView onto the old Layout types. It is ok for basic needs, but it quickly falls apart when you dig deeper. It doesn't support UI virtualization, and it doesn't even work well with all layouts (see the "Important" bubble in that doc). |
Beta Was this translation helpful? Give feedback.
-
@KPixel the layout system for MAUI is going to be very generic @hartez has the first pre-alpha v0.001 put together here where you can get an idea of where this is going. The layout system that exists inside of MAUI can't really be based on ItemRepeater or any XAML/Forms concept. It's something that needs to be used by Comet and other UI Frameworks That being said, everything is moving to interfaces which will enable people to create their own versions of layouts that can be used with forms There might be some wiggle room here on the MAUI side to possibly realize some of these ideas as we apply the MAUI versions of these layouts up into parts of Forms but I'm not too sure how fundamental of a change we can make. I am curious if it makes sense to realize an ItemRepeater instead of BindableLayout and then have that idea deeper integrated into the newer layouts BindableLayout, I feel, has some API discovery issues and if we had something called an ItemRepeater then I think that'd get a bit more use I've pinged @hartez on this discussion as he's the one tackling our layouts. It might be a minute before we can reply to these ideas though. Once the MAUI layout code is at more of the beta level then we can spike some of these ideas a bit better Apologies for the slow reply on this one |
Beta Was this translation helpful? Give feedback.
-
TL;DR: Please, use something like ItemsRepeater as the foundation for the layout system in MAUI.
There are already many issues talking about the idea of re-drawing all controls in a cross-platform & consistent way (like #50 and #61).
Here, I am focusing on controls that "layout" other controls, and that don't have an "native look" to worry about.
These are: All Page types, Layout types and ItemsView types.
I would like to suggest rewriting them all to follow the design of the UWP ItemsRepeater:
ItemsView
element should be responsible for taking anItemsSource
and "hosting" its visual children.Layout
that informs how to arrange these children.ListView
type that has most of these compositions pre-wired.Note: Many current Layout types, like
Grid
andStackPanel
are already implemented with cross-platform layout code. And the currentCollectionView
has a primitive Layout property to choose between stacking the items and placing them in a grid. So, this proposal is an improvement on both of them.For reference, Avalonia is doing that: They ported ItemsRepeater from WinUI (from C++ to C#) and they are rewriting their higher-level layouts to use it, like their ListBox, starting with their ItemsPresenter.
This is a huge breaking change compared to Xamarin.Forms, but I am hopeful that it is worth it.
My understanding is that the WinUI team sees this approach as the future; but they can't push it everywhere for backward compatibility reasons.
Beta Was this translation helpful? Give feedback.
All reactions