protected override void Build(StackLayout stackLayout) { base.Build(stackLayout); var currentItemContainer = new ValueViewContainer <CarouselView>(Test.CarouselView.CurrentItem, new CarouselView { HeightRequest = 250, ItemsSource = GetCarouselItems(), ItemsLayout = GetCarouselLayout(ItemsLayoutOrientation.Horizontal), ItemTemplate = GetCarouselTemplate(), CurrentItem = _currentItem }, "CurrentItem", value => value.ToString()); var isSwipeEnabledContainer = new ValueViewContainer <CarouselView>(Test.CarouselView.IsSwipeEnabled, new CarouselView { IsSwipeEnabled = false, HeightRequest = 250, ItemsSource = GetCarouselItems(), ItemsLayout = GetCarouselLayout(ItemsLayoutOrientation.Horizontal), ItemTemplate = GetCarouselTemplate() }, "IsSwipeEnabled", value => value.ToString()); var isBounceEnabledContainer = new ValueViewContainer <CarouselView>(Test.CarouselView.IsBounceEnabled, new CarouselView { IsBounceEnabled = false, HeightRequest = 250, ItemsSource = GetCarouselItems(), ItemsLayout = GetCarouselLayout(ItemsLayoutOrientation.Horizontal), ItemTemplate = GetCarouselTemplate() }, "IsBounceEnabled", value => value.ToString()); var isScrollAnimatedContainer = new ValueViewContainer <CarouselView>(Test.CarouselView.IsScrollAnimated, new CarouselView { IsScrollAnimated = false, HeightRequest = 250, ItemsSource = GetCarouselItems(), ItemsLayout = GetCarouselLayout(ItemsLayoutOrientation.Horizontal), ItemTemplate = GetCarouselTemplate() }, "IsScrollAnimated", value => value.ToString()); var peekAreaInsetsContainer = new ValueViewContainer <CarouselView>(Test.CarouselView.PeekAreaInsets, new CarouselView { PeekAreaInsets = new Thickness(24, 12, 36, 6), HeightRequest = 250, ItemsSource = GetCarouselItems(), ItemsLayout = GetCarouselLayout(ItemsLayoutOrientation.Horizontal), ItemTemplate = GetCarouselTemplate() }, "PeekAreaInsets", value => value.ToString()); var positionContainer = new ValueViewContainer <CarouselView>(Test.CarouselView.Position, new CarouselView { Position = 2, HeightRequest = 250, ItemsSource = GetCarouselItems(), ItemsLayout = GetCarouselLayout(ItemsLayoutOrientation.Horizontal), ItemTemplate = GetCarouselTemplate() }, "Position", value => value.ToString()); Add(currentItemContainer); Add(isSwipeEnabledContainer); Add(isBounceEnabledContainer); Add(isScrollAnimatedContainer); Add(peekAreaInsetsContainer); Add(positionContainer); }
protected override void Build(StackLayout stackLayout) { base.Build(stackLayout); var isCheckedContainer = new ValueViewContainer <CheckBox>(Test.CheckBox.IsChecked, new CheckBox() { IsChecked = true, HorizontalOptions = LayoutOptions.Start }, "IsChecked", value => value.ToString()); Add(isCheckedContainer); var checkedColorContainer = new ValueViewContainer <CheckBox>(Test.CheckBox.CheckedColor, new CheckBox() { IsChecked = true, Color = Color.Orange, HorizontalOptions = LayoutOptions.Start }, "Color", value => value.ToString()); Add(checkedColorContainer); var groupList = new VisualStateGroupList(); var group = new VisualStateGroup(); var checkedVisualState = new VisualState { Name = "IsChecked" }; checkedVisualState.Setters.Add(new Setter { Property = CheckBox.ColorProperty, Value = Color.Orange }); group.States.Add(checkedVisualState); var normalVisualState = new VisualState { Name = "Normal" }; normalVisualState.Setters.Add(new Setter { Property = CheckBox.ColorProperty, Value = Color.Red }); group.States.Add(normalVisualState); groupList.Add(group); var checkBoxStateManaged = new CheckBox() { Color = Color.Red, HorizontalOptions = LayoutOptions.Start }; VisualStateManager.SetVisualStateGroups(checkBoxStateManaged, groupList); var unCheckedColorContainer = new ValueViewContainer <CheckBox>(Test.CheckBox.UncheckedColor, checkBoxStateManaged, "Color", value => value.ToString()); Add(unCheckedColorContainer); }
protected override void Build(StackLayout stackLayout) { base.Build(stackLayout); var maximumContainer = new ValueViewContainer <Slider>(Test.Slider.Maximum, new Slider { Maximum = 10, Minimum = 5 }, "Value", value => value.ToString()); var minimumContainer = new ValueViewContainer <Slider>(Test.Slider.Minimum, new Slider { Maximum = 10 }, "Value", value => value.ToString()); var valueContainer = new ValueViewContainer <Slider>(Test.Slider.Value, new Slider { Value = 0.5 }, "Value", value => value.ToString()); var minTrackColorContainer = new ValueViewContainer <Slider>(Test.Slider.MinimumTrackColor, new Slider { MinimumTrackColor = Color.Red, Value = 0.5 }, "Value", value => value.ToString()); var maxTrackColorContainer = new ValueViewContainer <Slider>(Test.Slider.MaximumTrackColor, new Slider { MaximumTrackColor = Color.Red, Value = 0.5 }, "Value", value => value.ToString()); var thumbColorContainer = new ValueViewContainer <Slider>(Test.Slider.ThumbColor, new Slider { ThumbColor = Color.Red, Value = 0.5 }, "Value", value => value.ToString()); var thumbImageContainer = new ValueViewContainer <Slider>(Test.Slider.ThumbImage, new Slider { ThumbImageSource = "coffee.png", Value = 0.5 }, "Value", value => value.ToString()); var dragStartedContainer = new EventViewContainer <Slider>(Test.Slider.DragStarted, new Slider { Value = 0.5 }); dragStartedContainer.View.DragStarted += (sender, args) => dragStartedContainer.EventFired(); var dragCompletedContainer = new EventViewContainer <Slider>(Test.Slider.DragCompleted, new Slider { Value = 0.5 }); dragCompletedContainer.View.DragCompleted += (sender, args) => dragCompletedContainer.EventFired(); Add(maximumContainer); Add(minimumContainer); Add(valueContainer); Add(minTrackColorContainer); Add(maxTrackColorContainer); Add(thumbColorContainer); Add(thumbImageContainer); Add(dragStartedContainer); Add(dragCompletedContainer); }
protected override void Build(StackLayout stackLayout) { base.Build(stackLayout); var maximumContainer = new ValueViewContainer <Stepper>(Test.Stepper.Maximum, new Stepper { Maximum = 10 }, "Value", value => value.ToString()); var minimumContainer = new ValueViewContainer <Stepper>(Test.Stepper.Minimum, new Stepper { Minimum = 2 }, "Value", value => value.ToString()); var incrememtContainer = new ValueViewContainer <Stepper>(Test.Stepper.Increment, new Stepper { Maximum = 20, Minimum = 10, Increment = 2 }, "Value", value => value.ToString()); Add(maximumContainer); Add(minimumContainer); Add(incrememtContainer); }
protected override void Build(StackLayout stackLayout) { base.Build(stackLayout); var isToggledContainer = new ValueViewContainer <Switch>(Test.Switch.IsToggled, new Switch(), "IsToggled", value => value.ToString()); var onColoredSwitch = new Switch() { OnColor = Color.HotPink }; var onColorContainer = new ValueViewContainer <Switch>(Test.Switch.OnColor, onColoredSwitch, "OnColor", value => value.ToString()); var changeOnColorButton = new Button { Text = "Change OnColor" }; var clearOnColorButton = new Button { Text = "Clear OnColor" }; changeOnColorButton.Clicked += (s, a) => { onColoredSwitch.OnColor = Color.Red; }; clearOnColorButton.Clicked += (s, a) => { onColoredSwitch.OnColor = Color.Default; }; onColorContainer.ContainerLayout.Children.Add(changeOnColorButton); onColorContainer.ContainerLayout.Children.Add(clearOnColorButton); var thumbColorSwitch = new Switch() { ThumbColor = Color.Yellow }; var thumbColorContainer = new ValueViewContainer <Switch>(Test.Switch.ThumbColor, thumbColorSwitch, nameof(Switch.ThumbColor), value => value.ToString()); var changeThumbColorButton = new Button { Text = "Change ThumbColor", Command = new Command(() => thumbColorSwitch.ThumbColor = Color.Lime) }; var clearThumbColorButton = new Button { Text = "Clear ThumbColor", Command = new Command(() => thumbColorSwitch.ThumbColor = Color.Default) }; thumbColorContainer.ContainerLayout.Children.Add(changeThumbColorButton); thumbColorContainer.ContainerLayout.Children.Add(clearThumbColorButton); Add(isToggledContainer); Add(onColorContainer); Add(thumbColorContainer); }
protected override void Build(StackLayout stackLayout) { base.Build(stackLayout); var rightItemsContainer = new ValueViewContainer <SwipeView>(Test.SwipeView.RightItems, new SwipeView { RightItems = GetRevealSwipeItems(), Content = GetSwipeContent(SwipeDirection.Right), HeightRequest = 60, BackgroundColor = Color.LightPink }, "RightItems", value => value.ToString()); var topItemsContainer = new ValueViewContainer <SwipeView>(Test.SwipeView.TopItems, new SwipeView { TopItems = GetRevealSwipeItems(), Content = GetSwipeContent(SwipeDirection.Up), HeightRequest = 60, BackgroundColor = Color.LightSkyBlue }, "TopItems", value => value.ToString()); var bottomItemsContainer = new ValueViewContainer <SwipeView>(Test.SwipeView.BottomItems, new SwipeView { BottomItems = GetRevealSwipeItems(), Content = GetSwipeContent(SwipeDirection.Down), HeightRequest = 60, BackgroundColor = Color.LightGray }, "BottomItems", value => value.ToString()); Add(rightItemsContainer); Add(topItemsContainer); Add(bottomItemsContainer); }
protected override void Build(StackLayout stackLayout) { base.Build(stackLayout); IsEnabledStateViewContainer.View.CheckedChanged += (sender, args) => IsEnabledStateViewContainer.TitleLabel.Text += " (Checked Changed)"; var borderButtonContainer = new ViewContainer <RadioButton>(Test.Button.BorderColor, new RadioButton { Content = "BorderColor", BackgroundColor = Colors.Transparent, BorderColor = Colors.Red, BorderWidth = 1, } ); var borderRadiusContainer = new ViewContainer <RadioButton>(Test.Button.BorderRadius, new RadioButton { Content = "BorderRadius", BackgroundColor = Colors.Transparent, BorderColor = Colors.Red, BorderWidth = 1, } ); var borderWidthContainer = new ViewContainer <RadioButton>(Test.Button.BorderWidth, new RadioButton { Content = "BorderWidth", BackgroundColor = Colors.Transparent, BorderColor = Colors.Red, BorderWidth = 15, } ); var fontContainer = new ViewContainer <RadioButton>(Test.Button.Font, new RadioButton { Content = "Font", FontSize = Device.GetNamedSize(NamedSize.Large, typeof(RadioButton)), FontAttributes = FontAttributes.Bold } ); var textContainer = new ViewContainer <RadioButton>(Test.Button.Text, new RadioButton { Content = "Text" } ); var textColorContainer = new ViewContainer <RadioButton>(Test.Button.TextColor, new RadioButton { Content = "TextColor", TextColor = Colors.Pink } ); var paddingContainer = new ViewContainer <RadioButton>(Test.Button.Padding, new RadioButton { Content = "Padding", BackgroundColor = Colors.Red, Padding = new Thickness(20, 30, 60, 15) } ); var isCheckedContainer = new ValueViewContainer <RadioButton>(Test.RadioButton.IsChecked, new RadioButton() { IsChecked = true, HorizontalOptions = LayoutOptions.Start }, "IsChecked", value => value.ToString()); Add(borderButtonContainer); Add(borderRadiusContainer); Add(borderWidthContainer); Add(fontContainer); Add(textContainer); Add(textColorContainer); Add(paddingContainer); Add(isCheckedContainer); }