Have a look at this thread:
http://mono-for-android.1047100.n5.nabble.com/Convert-net-type-to-Java-Lang-Object-how-td5710021.html#a5710144

It seems that a few people are doing this already.
Maybe the mono guys could include it in the main set?


Matthew


On Wed, Jul 11, 2012 at 1:02 PM, andyjohnson0 <andyjohns...@gmail.com>wrote:

> In a recent MfA project I needed to link UI elements (derived from View) to
> their corresponding data model object (derived from System.Object). The
> most
> natural way to do this was to use the View.Tag property. Since this is a
> java.lang.Object reference, I had to write a generic class that derives
> from
> java.lang.Object and wraps a System.Object reference.
>
> This seems like it should be unnecessary for two reasons: it complicates
> the
> code where the Tag property is set and got, and it adds two extra object
> instances (a java object and a c# proxy).
>
> Am I missing something, or is this best/acceptable practice? If it is the
> standard solution, does Mono for Android provide a predefined class for
> this? I have been unable to find one.
>
> Is this just a special-case of a more general problem arising from having
> two type-system roots, and is there any guidance available on this?
>
> Thanks, Andy.
>
>
> --
> View this message in context:
> http://mono-for-android.1047100.n5.nabble.com/Type-systems-java-lang-Object-and-System-Object-tp5710827.html
> Sent from the Mono for Android mailing list archive at Nabble.com.
> _______________________________________________
> Monodroid mailing list
> Monodroid@lists.ximian.com
>
> UNSUBSCRIBE INFORMATION:
> http://lists.ximian.com/mailman/listinfo/monodroid
>
_______________________________________________
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to