diff options
Diffstat (limited to 'Xamarin.Forms.Controls/GalleryPages/NavigationBarGallery.cs')
-rw-r--r-- | Xamarin.Forms.Controls/GalleryPages/NavigationBarGallery.cs | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/Xamarin.Forms.Controls/GalleryPages/NavigationBarGallery.cs b/Xamarin.Forms.Controls/GalleryPages/NavigationBarGallery.cs new file mode 100644 index 00000000..dfbc342c --- /dev/null +++ b/Xamarin.Forms.Controls/GalleryPages/NavigationBarGallery.cs @@ -0,0 +1,62 @@ +using System.Diagnostics; + +namespace Xamarin.Forms.Controls +{ + public class NavigationBarGallery : ContentPage + { + public NavigationBarGallery (NavigationPage rootNavPage) + { + + int toggleBarTextColor = 0; + int toggleBarBackgroundColor = 0; + + Content = new StackLayout { + Children = { + new Button { + Text = "Change BarTextColor", + Command = new Command (() => { + if (toggleBarTextColor % 2 == 0) { + rootNavPage.BarTextColor = Color.Teal; + } else { + rootNavPage.BarTextColor = Color.Default; + } + toggleBarTextColor++; + }) + }, + new Button { + Text = "Change BarBackgroundColor", + Command = new Command (() => { + if (toggleBarBackgroundColor % 2 == 0) { + rootNavPage.BarBackgroundColor = Color.Navy; + } else { + rootNavPage.BarBackgroundColor = Color.Default; + } + toggleBarBackgroundColor++; + + }) + }, + new Button { + Text = "Change Both to default", + Command = new Command (() => { + rootNavPage.BarTextColor = Color.Default; + rootNavPage.BarBackgroundColor = Color.Default; + }) + }, + new Button { + Text = "Make sure Tint still works", + Command = new Command (() => { + rootNavPage.Tint = Color.Red; + }) + }, + new Button { + Text = "Black background, white text", + Command = new Command (() => { + rootNavPage.BarTextColor = Color.White; + rootNavPage.BarBackgroundColor = Color.Black; + }) + } + } + }; + } + } +}
\ No newline at end of file |