Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Apply implicit style to all pages inherited from content pages

$
0
0

I have looked over the documentation and read up on implicit styles. I simply want all pages that inherit from ContentPage to have the same background color.

Here is what I am trying currently that is not working:

            // The Application ResourceDictionary is available in Xamarin.Forms 1.3 and later
            Application.Current.Resources = new ResourceDictionary ();
            var appStyle = new Style (typeof(ContentPage)) {
                Setters = {
                    new Setter { Property = ContentPage.BackgroundColorProperty, Value = Color.Aqua }
                }
            };
            Application.Current.Resources.Add (appStyle); // use the "AppStyle" key in the app

Any help would be greatly appreciated!


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>