public CustomFloatingactionbutton(ActionButtonView View) { _view = View; SetIcon(); Layer.CornerRadius = (nfloat)_view.HeightRequest / 2; BackgroundColor = _view.BackgroundColor.ToUIColor(); heightConstraint = HeightAnchor.ConstraintEqualTo((nfloat)View.HeightRequest); heightConstraint.Active = true; widthConstraint = WidthAnchor.ConstraintEqualTo((nfloat)View.HeightRequest); widthConstraint.Active = true; TouchDown += delegate(object sender, EventArgs e) { UIView.Animate(0.1, 0, UIViewAnimationOptions.Autoreverse, () => { BackgroundColor = View.SelectedColor.ToUIColor(); }, () => { BackgroundColor = View.BackgroundColor.ToUIColor(); }); View.ClickAction(); }; _view.PropertyChanged += _view_PropertyChanged; }
private void CustomFloatingActionButton_Click(object sender, EventArgs e) { _renderer.ClickAction(); }