change color barBackgroundColor from MasterDetailPage

Luis_dmLuis_dm USMember ✭✭✭
edited December 2016 in Xamarin.Forms

I would like to know if it is possible to change the color of the "barBackgroundColor" of the "navigationPage", what happens is that I have a page where it has a list of colors and when you choose a color, it sends that color to the page of MasterDetail but nothing happens:,Do I need that it runs in real-time? a task?


        <local:MenuPage x:Name="ContePageMenu"/>
        <NavigationPage x:Name="Navigator"  BarBackgroundColor="{DynamicResource ColorAzul}" BarTextColor="{DynamicResource ColorBlanco}">


  • AlexDunnAlexDunn USMember ✭✭✭

    Yeah you can totally do this. In fact, the BarBackgroundColor is a fully bindable property.
    You could set up a ViewModel that acts as the BindingContext for your navigation page that has a Color property. You could then update that ViewModel's Color property from your list page and it will automatically update the color of bar accordingly.

  • TiagoRodriguesNesTiagoRodriguesNes USMember ✭✭

    Have you solved your problem?
    I have a similar 1.

    I've tried multiple approaches but the bar never changes color.

  • TiagoRodriguesNesTiagoRodriguesNes USMember ✭✭

    This did the trick for me.


        <NavigationPage x:Name="detailPage">


    detailPage.BarBackgroundColor = Settings.SECONDARY_COLOR;
Sign In or Register to comment.