UIButton add Clickable later on

Im trying to generate my View in a seperate class and let the controller do all the binding and stuff
so my problem is that when i assing a clickable action on button create like this:

var btn = new Button(ActionMethod);

then the Action is called like it should

but when i create a Button like this

var btn = new Button();
btn.clickable = new Clickable(ActionMethod);

nothing happens, even when i add this line

btn.AddManipulator(btn.clickable);

nothing. (I Saw this last line in the constructor of Button)

I dont get what i’m doing wrong here!

This api will be improved in the future. For the moment, you can try:
btn.clickable.clicked += ActionMethod;

1 Like

Thank you! this works!