Closed MattePozzy closed 1 year ago
you can navigate to a new page: https://adospace.gitbook.io/mauireactor/components/navigation/navigation
you can also swap the window content with code like this: https://adospace.gitbook.io/mauireactor/components/window
Why don't you just render a different component based on state?
internal class MainPageState
{
public bool IsAuthenticated { get; set; }
}
internal class MainPage : Component<MainPageState>
{
public override VisualNode Render()
{
if (!State.IsAuthenticated)
{
return new LoginPage()
.OnLoggedIn(loginResult =>
SetState(x => x.IsAuthenticated = loginResult.IsSuccess));
}
return new ShellPage();
}
}
Why don't you just render a different component based on state?
internal class MainPageState { public bool IsAuthenticated { get; set; } } internal class MainPage : Component<MainPageState> { public override VisualNode Render() { if (!State.IsAuthenticated) { return new LoginPage() .OnLoggedIn(loginResult => SetState(x => x.IsAuthenticated = loginResult.IsSuccess)); } return new ShellPage(); } }
I have done a sort of! Thank you
Hi, I need to change the main page and navigate to it, at runtime.
In Xamarin.forms I did in this way:
How can I do with ReactorUi? Thank you.