adospace / reactorui-maui

MauiReactor is a MVU UI framework built on top of .NET MAUI
MIT License
588 stars 49 forks source link

is BindableLayout supported? #181

Closed nor0x closed 10 months ago

nor0x commented 10 months ago

I was wondering how I could port the following MAUI XAML code to reactorui-maui (which is an awesome piece of software, thank you so much for building it 👏)

<StackLayout
        Orientation="Horizontal"
        BindableLayout.ItemsSource="{Binding MyItems}">
    <BindableLayout.ItemTemplate>
        <DataTemplate>
        ...
        </DataTemplate>
    </BindableLayout.ItemTemplate>
</StackLayout>

BindableLayout is helpful for Layout derivatives to render children bound to an ItemsSource. Unfortunately I was not able to find some information about the support for BindableLayout in the docs or in the source of this repository.

adospace commented 10 months ago

Hi, yes you "could" use BindableLayout in MauiReactor too but you won't find any documentation on that because actually in MVU things are much easier:

new HStack
{
    State.MyItems.Select(RenderItem)
}

VisualNode RenderItem(Item item)
   => new Label(item.Name);
nor0x commented 10 months ago

of course, that make sense! thank you 😄