Example #1
0
        protected override void OnElementChanged(ElementChangedEventArgs <Stepper> e)
        {
            base.OnElementChanged(e);

            if (e.OldElement == null)
            {
                if (Control == null)
                {
                    var layout = CreateNativeControl();
                    StepperRendererManager.CreateStepperButtons(this, out _downButton, out _upButton);
                    layout.AddView(_downButton, new LinearLayout.LayoutParams(LayoutParams.WrapContent, LayoutParams.MatchParent)
                    {
                        Weight      = 1,
                        RightMargin = (int)(Context.ToPixels(DefaultButtonSpacing) / 2),
                    });
                    layout.AddView(_upButton, new LinearLayout.LayoutParams(LayoutParams.WrapContent, LayoutParams.MatchParent)
                    {
                        Weight     = 1,
                        LeftMargin = (int)(Context.ToPixels(DefaultButtonSpacing) / 2),
                    });

                    SetNativeControl(layout);
                }
            }

            StepperRendererManager.UpdateButtons(this, _downButton, _upButton);
            UpdateInputTransparent();
        }