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

Reply via email to