protected override void OnElementChanged(ElementChangedEventArgs <PancakeView> e) { if (Control == null) { SetNativeControl(new ElmSharp.Box(Forms.NativeParent)); Control.SetLayoutCallback(OnLayout); _roundRectangle = new RoundRectangle(Forms.NativeParent); _roundRectangle.Show(); _borderRectangle = new BorderRectangle(Forms.NativeParent); _borderRectangle.Show(); Control.PackEnd(_roundRectangle); Control.PackEnd(_borderRectangle); } var pancake = (Element as PancakeView); UpdateCornerRadius(pancake); UpdateBorder(pancake); PackChild(); base.OnElementChanged(e); }
protected override void OnElementChanged(ElementChangedEventArgs <Stepper> e) { if (Control == null) { var outter = new EBox(System.Maui.Maui.NativeParent) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, IsHorizontal = true, }; outter.SetPadding(horizontalPadding, 0); outter.Show(); outter.SetLayoutCallback(OnLayout); _borderL = new BorderRectangle(System.Maui.Maui.NativeParent); _borderL.Show(); _borderL.SetRadius(radius); _borderL.BorderWidth = borderWidth; _borderL.Color = defaultColor; _buttonL = new MButton(System.Maui.Maui.NativeParent) { BackgroundColor = EColor.Transparent, Text = "<span color='#000000'>-</span>", }; _buttonL.Show(); _buttonL.Clicked += OnDecrementButtonClicked; outter.PackEnd(_borderL); outter.PackEnd(_buttonL); _borderR = new BorderRectangle(System.Maui.Maui.NativeParent); _borderR.Show(); _borderR.SetRadius(radius); _borderR.BorderWidth = borderWidth; _borderR.Color = defaultColor; _buttonR = new MButton(System.Maui.Maui.NativeParent) { BackgroundColor = EColor.Transparent, Text = "<span color='#000000'>+</span>", }; _buttonR.Show(); _buttonR.Clicked += OnIncrementButtonClicked; outter.PackEnd(_borderR); outter.PackEnd(_buttonR); SetNativeView(outter); } UpdateValue(); UpdateIncrement(); UpdateMinimum(); UpdateMaximum(); base.OnElementChanged(e); }