[MonoTouch] Button CommandArgument Equivalent?

René Ruppert rene.ruppert at googlemail.com
Wed Oct 26 11:39:26 EDT 2011


Maybe Subclass UIButton and add a property as you need. Then you can use
that in your event handler after casting the sender back to your button.

Grüße, René

Am 26.10.2011 um 17:36 schrieb Jason Awbrey <jason at awbrey.net>:

I use Tag for this.  It works, and I haven't found a better way to do it

On Wed, Oct 26, 2011 at 10:18 AM, MilkyJoe <leigh.bowers at curvenet.co.uk>wrote:

> In ASP.Net, I use the CommandArgument property of the Button control to
> pass
> values to the OnCommand event. Is there an equivalent in iOS/MonoTouch?
>
> Basically, I have a collection of buttons that are all attached to the same
> TouchUpInside action. I need to be able to assign a value to each button so
> that, when clicked, I can load the appropriate data from the database.
>
> At the moment, I'm using the Tag property for this, although I'm guessing
> this is not its intended purpose.
>
> Thanks
>
> --
> View this message in context:
> http://monotouch.2284126.n4.nabble.com/Button-CommandArgument-Equivalent-tp3940979p3940979.html
> Sent from the MonoTouch mailing list archive at Nabble.com.
> _______________________________________________
> MonoTouch mailing list
> MonoTouch at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/monotouch
>

_______________________________________________
MonoTouch mailing list
MonoTouch at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/monotouch/attachments/20111026/5d6ff1c8/attachment.html 


More information about the MonoTouch mailing list