How to change backGround color in Xamarin forms NavigationPage

Just set the BarBackgroundColor property of the NavigationPage instance:

new NavigationPage(new LoginPage()) { BarBackgroundColor = Color.Green };

If you want to setup a global style in xaml, you could something similar to this:

<?xml version="1.0" encoding="utf-8" ?>
<Application xmlns="http://xamarin.com/schemas/2014/forms"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    x:Class="Sample.App">
    <Application.Resources>

        <ResourceDictionary>
            <Style TargetType="NavigationPage">
                <Setter Property="BarBackgroundColor" Value="#ff5733"/>
                <Setter Property="BarTextColor" Value="White"/>
            </Style>
        </ResourceDictionary>

    </Application.Resources>
</Application>