Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Command not called from Command parameter in custom control

$
0
0

Hi folks,

I'm trying to create a custom control, derived from Button (not from "View") which has some added BindableProperties on it. This is what I've tried - in order to get the tap functionality of the button from the control and to map the press to the "Command=" parameter.

I click the button and there is no error in the console and my command is not hit as requested in xaml with Command="ButtonClickedCommand" in the element's attributes (since it's a Button).

Am I trying to do something wrong? Am I going about it at the simplest way to repaint a button the way I want while getting access to its Command binding? (in xaml, the attribute is like this: Command="{Binding ButtonClickedCommand}").

    public Command ButtonClickedCommand
    {
        get
        {
            return new Command(() =>
            {
                int i = 0;  // breakpoint here never hit
            });
        }
    }

Thanks!
Mike


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>