예제 #1
0
        static Layout CreateCollapseWidthAdjuster(Xamarin.Forms.FlyoutPage page)
        {
            var label = new Xamarin.Forms.Label
            {
                Text = "Adjust Collapsed Width",
                VerticalTextAlignment = TextAlignment.Center,
                VerticalOptions       = LayoutOptions.Center
            };

            var entry = new Entry {
                Text = page.On <Windows>().CollapsedPaneWidth().ToString()
            };
            var button = new Button {
                Text = "Change", BackgroundColor = Color.Gray
            };

            button.Clicked += (sender, e) =>
            {
                double width;
                if (double.TryParse(entry.Text, out width))
                {
                    page.On <Windows>().CollapsedPaneWidth(width);
                }
            };

            return(new StackLayout
            {
                Orientation = StackOrientation.Horizontal,
                HorizontalOptions = LayoutOptions.Center,
                Children = { label, entry, button }
            });
        }
예제 #2
0
        static Layout CreateCollapseStyleChanger(Xamarin.Forms.FlyoutPage 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"));
        }