[mono-android] SPAM-LOW: Passing a class between classes
Paul F. Johnson
paul at all-the-johnsons.co.uk
Mon Nov 21 14:31:57 EST 2011
Hi Karl
> If xmlhandler is an activitie, and if i'ts not possible to add an overrided
> constructor with Common as a parameter, you can make common data as public
> property on xmlhandler and construct it "by hand" putting there the value..
This is the problem - I'm not exactly sure how to override the ctor. For
example, under normal rules (winforms) I would do this
foo = new bar(data)
//
common data;
public bar(common data)
{
this.data = data;
}
Under mono for android, I can't see where I'd do this. For example, on a
tabview, there isn't anywhere to pass it in (from what I can see). I
can't use
public class Results : Activity
{
common data;
protected override void OnCreate(Bundle savedInstanceState, common
data)
{
this.data = data;
//
}
}
as OnCreate only has one parameter. I'm not sure a delegate would work
either
delegate (Bundle b) { OnCreate(b, data); };
could be a way forward, but it's messy... Argh!!!!
> Or you can create a Form class and create this xmlhandler : Form and use at
> the same way..
Not with you here...
Paul
--
Vertraue mir, ich weiss, was ich mache...
More information about the Monodroid
mailing list