Exemplo n.º 1
0
        public IconTextButton()
        {
            InitializeComponent();

            // Creates the Gesture that will be handle the Taps
            var gesture = new TapGestureRecognizer();

            gesture.Tapped += (s, e) => {
                if (IsAnimateOnClick)
                {
                    Task.Run(async() => {
                        AnchorX = 0.48;
                        AnchorY = 0.48;

                        await ButtonPanel.ScaleTo(0.8, 50, Easing.Linear);
                        await Task.Delay(100);
                        await ButtonPanel.ScaleTo(1, 50, Easing.Linear);
                    });
                }

                Clicked?.Invoke(this, EventArgs.Empty);
                Command?.Execute(CommandParameter);
            };
            GestureRecognizers.Add(gesture);
        }