Exemple #1
0
        ContentPage CreateContentPageOne()
        {
            var returnButton = new Button {
                Text = "Return to Platform-Specifics List"
            };

            returnButton.Clicked += (sender, e) => _returnToPlatformSpecificsPage.Execute(null);

            return(new ContentPage
            {
                Title = "ContentPage One",
                Icon = "csharp.png",
                Content = new StackLayout
                {
                    Margin = new Thickness(20),
                    Children =
                    {
                        new Label {
                            Text = "Toolbar Items", FontAttributes = FontAttributes.Bold, HorizontalOptions = LayoutOptions.Center
                        },
                        WindowsPlatformSpecificsHelpers.CreateAddRemoveToolbarItemButtons(this),
                        WindowsPlatformSpecificsHelpers.CreateToolbarPlacementChanger(this),
                        returnButton
                    }
                }
            });
        }
Exemple #2
0
        ContentPage CreateContentPageOne()
        {
            var navigateButton = new Button {
                Text = "Navigate", HorizontalOptions = LayoutOptions.Center
            };

            navigateButton.Clicked += async(sender, e) => await PushAsync(CreateContentPageTwo());

            return(new ContentPage
            {
                Title = "ContentPage One",
                Content = new StackLayout
                {
                    Margin = new Thickness(20),
                    Children =
                    {
                        new Label {
                            Text = "Toolbar Items", FontAttributes = FontAttributes.Bold, HorizontalOptions = LayoutOptions.Center
                        },
                        WindowsPlatformSpecificsHelpers.CreateAddRemoveToolbarItemButtons(this),
                        WindowsPlatformSpecificsHelpers.CreateToolbarPlacementChanger(this),
                        navigateButton
                    }
                }
            });
        }
Exemple #3
0
        public WindowsTabbedPageCS(ICommand restore)
        {
            _returnToPlatformSpecificsPage = restore;

            Children.Add(CreateContentPageOne());
            Children.Add(CreateContentPageTwo());
            WindowsPlatformSpecificsHelpers.AddToolBarItems(this);
        }
        static Layout CreateCollapseStyleChanger(Xamarin.Forms.MasterDetailPage page)
        {
            var enumType = typeof(CollapseStyle);

            return(WindowsPlatformSpecificsHelpers.CreateChanger(enumType, Enum.GetName(enumType, page.On <Windows>().GetCollapseStyle()), picker =>
            {
                page.On <Windows>().SetCollapseStyle((CollapseStyle)Enum.Parse(enumType, picker.Items[picker.SelectedIndex]));
            }, "Select Collapse Style"));
        }
        public WindowsMasterDetailPageCS()
        {
            On <Windows>().SetCollapseStyle(CollapseStyle.Partial);
            MasterBehavior = MasterBehavior.Popover;

            Master = CreateMasterPage();
            Detail = detailPage = CreateDetailPage();
            WindowsPlatformSpecificsHelpers.AddToolBarItems(this);
        }
Exemple #6
0
        public WindowsFlyoutPageCS(ICommand restore)
        {
            _returnToPlatformSpecificsPage = restore;

            On <Windows>().SetCollapseStyle(CollapseStyle.Partial);
            FlyoutLayoutBehavior = FlyoutLayoutBehavior.Popover;

            Flyout = CreateFlyoutPage();
            Detail = detailPage = CreateDetailPage();
            WindowsPlatformSpecificsHelpers.AddToolBarItems(this);
        }
Exemple #7
0
 ContentPage CreateContentPageOne()
 {
     return(new ContentPage
     {
         Title = "ContentPage One",
         Content = new StackLayout
         {
             Margin = new Thickness(20),
             Children =
             {
                 new Label {
                     Text = "Toolbar Items", FontAttributes = FontAttributes.Bold, HorizontalOptions = LayoutOptions.Center
                 },
                 WindowsPlatformSpecificsHelpers.CreateAddRemoveToolbarItemButtons(this),
                 WindowsPlatformSpecificsHelpers.CreateToolbarPlacementChanger(this)
             }
         }
     });
 }
Exemple #8
0
 public WindowsNavigationPageCS()
 {
     WindowsPlatformSpecificsHelpers.AddToolBarItems(this);
     PushAsync(CreateContentPageOne());
 }
Exemple #9
0
 public WindowsNavigationPageCS(ICommand restore)
 {
     _returnToPlatformSpecificsPage = restore;
     WindowsPlatformSpecificsHelpers.AddToolBarItems(this);
     PushAsync(CreateContentPageOne());
 }
Exemple #10
0
 public WindowsTabbedPageCS()
 {
     Children.Add(CreateContentPageOne());
     Children.Add(CreateContentPageTwo());
     WindowsPlatformSpecificsHelpers.AddToolBarItems(this);
 }