Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not Customise Navigation Pages #20

Open
Bumbar14 opened this issue Sep 6, 2024 · 0 comments
Open

Can not Customise Navigation Pages #20

Bumbar14 opened this issue Sep 6, 2024 · 0 comments

Comments

@Bumbar14
Copy link

Bumbar14 commented Sep 6, 2024

Hi,

I am a newbie, but I followed the official documentation for FreshMvvm on how to Customise Navigation Pages. It looks like the override function for CreateContainerPage does not work.

Here is my code

Customized navigation container
internal class CustomNavigationPage : FreshMvvm.Maui.FreshNavigationContainer
{

    public CustomNavigationPage(Page page) : base(page) 
    {
     
    }

    protected override Page CreateContainerPage(Page page)
    {
        var container = new NavigationPage(page);
        container.BarBackgroundColor = Color.FromArgb("#FF0000");

        return container;
    }
}

And app.xaml.cs

public App()
{
    InitializeComponent();
    
    var mainPage = FreshPageModelResolver.ResolvePageModel<TestPage1PageModel>();
    // var mainContainer = new FreshNavigationContainer(mainPage);
    var mainContainer = new CustomNavigationPage(mainPage);

    MainPage = mainContainer;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant