コード例 #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
                    }
                }
            });
        }
コード例 #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
                    }
                }
            });
        }
コード例 #3
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)
             }
         }
     });
 }