adospace / reactorui-maui

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

Back button behavior #80

Closed crimer closed 1 year ago

crimer commented 1 year ago

Hi I tried to handle custom callback on the back button click, but it's not working.

public class TestPage : Component
{
    public override VisualNode Render()
    {
        return new ContentPage()
            {
                new Button("next")
                    .OnClicked(async () =>
                    {
                        await Navigation?.PushAsync<TestPage>();
                    })
            }
            .Title("Test")
            .OnBackButtonPressed(() =>
            {
                Debug.WriteLine("adsd");
            })
            .BackButtonIsVisible(true)
            .BackButtonIsEnabled(true);
    }
}
public class App : Component
{
    public override VisualNode Render() => new NavigationPage()
        {
            new TestPage()
        };
}
adospace commented 1 year ago

Hi, just to understand, are you navigating to the same page TestPage?

crimer commented 1 year ago

Yes, purely for the test

Code-DJ commented 1 year ago

@crimer I tried your code and it works fine on iOS.

adospace commented 1 year ago

Tested and working on Android and Windows too, I'm closing this, let me know if you have more info