'How can I change the Color of the SECONDARY toolbar in Xamarin.Forms?

Currently I set the Primary toolbar background color with this code in the App.xaml.cs class:

//SET PRIMARY TOOLBAR COLOR
Current.Resources = new ResourceDictionary ();
Color xamarin_color = Color.FromHex ("#3498db");            
var navigationStyle = new Style (typeof (NavigationPage));
var barBackgroundColorSetter = new Setter { Property = NavigationPage.BarBackgroundColorProperty, Value = xamarin_color };          
navigationStyle.Setters.Add (barBackgroundColorSetter);         
Current.Resources.Add (navigationStyle);

The navigationPage PRIMARY toolbar changes its color correctly. But the SECONDARY toolbar doesn't change its default color (gray), and I cannot find any method or property to change it. How can I change the background color of the secondary toolbar?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source