adospace / reactorui-maui

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

VisualState is not working #229

Closed nomurayoshuak closed 2 months ago

nomurayoshuak commented 2 months ago

@adospace Hi, VisualState is not working in the my project and even sample app. https://github.com/adospace/reactorui-maui/tree/main/samples/MauiReactor.TestApp

It may not be a MauiReactor issue, but is there a solution? I run app on android emulator.

class CounterPage : Component<CounterPageState>
{
    public override VisualNode Render()
        => ContentPage("Counter Sample",
            VStack(
                Label($"Counter: {State.Counter}")
                    .AutomationId("Counter_Label")
                    .VisualState("CommonStates", "Normal", MauiControls.Label.BackgroundColorProperty, Colors.Aqua),

                Button("Click To Increment", () => SetState(s => s.Counter++))
                    .AutomationId("Counter_Button")
                    .VisualState("CommonStates", "Pressed", MauiControls.Button.BackgroundColorProperty, Colors.Aqua)
            )
            .Spacing(10)
            .Center()
        );

}
adospace commented 2 months ago

have you tried with a .NET MAUI classic project? I usually use the common state Selected for the collection view and it appears to be working

nomurayoshuak commented 2 months ago

What is a classic project? Does it mean a single project?

If there is a problem with VisualState, I would like to achieve the following. Is there an alternative in MauiReactor?

It likes this.

https://github.com/adospace/reactorui-maui/assets/57802609/12fc725e-80ce-40f5-aae6-0f5b5090c9ec

adospace commented 2 months ago

Fixed in version 2.0.36, updated documentation as well: https://adospace.gitbook.io/mauireactor/components/controls/button