adospace / reactorui-maui

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

Xaml integration State Of Component not Update the UI using BottomSheet #235

Closed Ali1Jamal closed 2 months ago

Ali1Jamal commented 2 months ago

i just try to warp this lib The49.Maui.BottomSheet but I cant because the page need to inherit BottomSheet and to create a page using MauiReactor I need to inherit Component class so I cant inherit two classes (BottomSheet, Component), so i decide to create the BottomSheetPage using xaml and the content of the page will be the Maui Reactor Component using xaml integration, its work but the state didn't update the ui ,for ex when click on Increment button using Counter Component the state of the Counter didn't change.

here is my Counter Component:

class CounterPageState
{
    public int Counter { get; set; }
}

class CounterPage : Component<CounterPageState>
{
    public override VisualNode Render()
        => VStack(spacing: 10, 
            Label($"Counter: {State.Counter}").Center(),
                Button("Click To Increment", () =>
                    SetState(s => s.Counter++))
            ).Center();
}

Screenshots telegram-cloud-photo-size-2-5298940421864544394-y

Smartphone :

adospace commented 2 months ago

have you looked at this? https://github.com/adospace/mauireactor-integration/tree/main/The49

Ali1Jamal commented 2 months ago

I don't know about mauireactor-integration before, The49 definitely works I test it with Counter and the state just works normally, also mauireactor-integration have nice integrations with other libs that will help me to understand how to warp almost any lib in the Future, thank you very much.