コード例 #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();
        }
コード例 #2
0
        protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            base.OnElementPropertyChanged(sender, e);

            StepperRendererManager.UpdateButtons(this, _downButton, _upButton, e);

            if (e.PropertyName == VisualElement.InputTransparentProperty.PropertyName)
            {
                UpdateInputTransparent();
            }
        }
コード例 #3
0
        protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            base.OnElementPropertyChanged(sender, e);

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