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 } } }); }
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 } } }); }
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); }
public WindowsFlyoutPageCS(ICommand restore) { _returnToPlatformSpecificsPage = restore; On <Windows>().SetCollapseStyle(CollapseStyle.Partial); FlyoutLayoutBehavior = FlyoutLayoutBehavior.Popover; Flyout = CreateFlyoutPage(); Detail = detailPage = CreateDetailPage(); WindowsPlatformSpecificsHelpers.AddToolBarItems(this); }
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) } } }); }
public WindowsNavigationPageCS() { WindowsPlatformSpecificsHelpers.AddToolBarItems(this); PushAsync(CreateContentPageOne()); }
public WindowsNavigationPageCS(ICommand restore) { _returnToPlatformSpecificsPage = restore; WindowsPlatformSpecificsHelpers.AddToolBarItems(this); PushAsync(CreateContentPageOne()); }
public WindowsTabbedPageCS() { Children.Add(CreateContentPageOne()); Children.Add(CreateContentPageTwo()); WindowsPlatformSpecificsHelpers.AddToolBarItems(this); }