0
votes

When using Prism 7+ as navigation framework in Xamarin Forms.

What would be most elegant way for changing the BarBackgroundColor of navigation page?

i Prism 6, there was a way for customizing navigation page using INavigationPageProvider , but that is no longer an option..

Ideally being able to change the color via binding to view model

1

1 Answers

0
votes

In Prism 7+ you can register you own custom NavigationPage using the usual containerRegistry.RegisterForNavigation<MyNavigationPage>();

Your NavigationPage needs to be inherited from Xamarin.Forms.NavigationPage.

Of course you can set the backgroundcolor, bind to a ViewModel etc... I'm adding ToolbarItems I need on all my other pages here.

Your first Navigation Action should look like this await NavigationService.NavigateAsync($"{nameof(MyNavigationPage)}/{nameof(MyFirstPage)}");