diff options
Diffstat (limited to 'Xamarin.Forms.Controls/GalleryPages/PlatformSpecificsGalleries/TabbedPageWindows.cs')
-rw-r--r-- | Xamarin.Forms.Controls/GalleryPages/PlatformSpecificsGalleries/TabbedPageWindows.cs | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/Xamarin.Forms.Controls/GalleryPages/PlatformSpecificsGalleries/TabbedPageWindows.cs b/Xamarin.Forms.Controls/GalleryPages/PlatformSpecificsGalleries/TabbedPageWindows.cs new file mode 100644 index 00000000..11b5d8c4 --- /dev/null +++ b/Xamarin.Forms.Controls/GalleryPages/PlatformSpecificsGalleries/TabbedPageWindows.cs @@ -0,0 +1,65 @@ +using System.Windows.Input; + +namespace Xamarin.Forms.Controls.GalleryPages.PlatformSpecificsGalleries +{ + public class TabbedPageWindows : TabbedPage + { + public TabbedPageWindows(ICommand restore) + { + Children.Add(CreateFirstPage(restore)); + Children.Add(CreateSecondPage()); + WindowsPlatformSpecificsGalleryHelpers.AddToolBarItems(this); + } + + ContentPage CreateFirstPage(ICommand restore) + { + var page = new ContentPage { Title = "Content Page Title" }; + + var content = new StackLayout + { + VerticalOptions = LayoutOptions.Fill, + HorizontalOptions = LayoutOptions.Fill + }; + content.Children.Add(new Label + { + Text = "Tabbed Page Windows Features", + FontAttributes = FontAttributes.Bold, + HorizontalTextAlignment = TextAlignment.Center, + VerticalTextAlignment = TextAlignment.Center + }); + + content.Children.Add(WindowsPlatformSpecificsGalleryHelpers.CreateToolbarPlacementChanger(this)); + content.Children.Add(WindowsPlatformSpecificsGalleryHelpers.CreateAddRemoveToolBarItemButtons(this)); + + var restoreButton = new Button { Text = "Back To Gallery" }; + restoreButton.Clicked += (sender, args) => restore.Execute(null); + content.Children.Add(restoreButton); + + page.Content = content; + + return page; + } + + static Page CreateSecondPage() + { + var cp = new ContentPage { Title = "Second Content Page" }; + + var content = new StackLayout + { + VerticalOptions = LayoutOptions.Fill, + HorizontalOptions = LayoutOptions.Fill + }; + content.Children.Add(new Label + { + Text = "Page 2", + FontAttributes = FontAttributes.Bold, + HorizontalTextAlignment = TextAlignment.Center, + VerticalTextAlignment = TextAlignment.Center + }); + + cp.Content = content; + + return cp; + } + } +}
\ No newline at end of file |