AButton IStepperRenderer.CreateButton() { var button = new AButton(Context); button.SetHeight((int)Context.ToPixels(10.0)); return(button); }
protected override void OnElementChanged(ElementChangedEventArgs <Stepper> e) { base.OnElementChanged(e); if (e.OldElement == null) { _downButton = new AButton(Context) { Text = "-", Gravity = GravityFlags.Center, Tag = this }; _downButton.SetHeight((int)Context.ToPixels(10.0)); _downButton.SetOnClickListener(StepperListener.Instance); _upButton = new AButton(Context) { Text = "+", Tag = this }; _upButton.SetOnClickListener(StepperListener.Instance); _upButton.SetHeight((int)Context.ToPixels(10.0)); var layout = CreateNativeControl(); layout.AddView(_downButton); layout.AddView(_upButton); SetNativeControl(layout); } UpdateButtonEnabled(); }
AButton IStepperHandler.CreateButton() { if (Context == null) { throw new ArgumentException("Context is null or empty", nameof(Context)); } var button = new AButton(Context); button.SetHeight((int)Context.ToPixels(10.0)); return(button); }