transfering data between screens in iPhone monotouch (Some thing like Monodroid Intent on monotouch) -
in monodroid doing operations used intents. illustration in 1 app both "saved search" , "search" page had 1 activity , when want called activity used codes this:
var filename = searchfilelist [args.position]; intent intent = new intent (this, typeof(searcharoundyouactivity)); intent.putextra (appconstants.searchaction, appconstants.savedsearch); intent.putextra (appconstants.searchoption, storageclass .searchpath +"/" + filename + "/state.rsf"); intent .putextra (appconstants .savedsearchname , storageclass .searchpath +"/" + filename); startactivity (intent); and in activity on create on used code:
action = intent.getstringextra (appconstants.searchaction); if (action == appconstants.savedsearch) { normalfilter = ((rplapp)application).typeofshow.content .filter .tostring (); ((rplapp)application).typeofshow.load (intent.getstringextra (appconstants.searchoption)); savename = intent .getstringextra (appconstants .savedsearchname ); } by method can observe whethere load saved info or run new search.
the question this: how can thing in monotouch?
maybe possible define static variables in screen class , check value propose, whether solutions recommended, , best way doing this?
on ios, should able pass these values in c# between 2 classes. android little weird in requiring stuff serialized , passed through intent.
so illustration in click event:
var mycontroller = new mycontroller(); mycontroller.setsomefield = true; //or pass want in via properties or methods presentviewcontroller(mycontroller, true, null); if want more "cross-platform-y", utilize messenger implementation both platforms. have 1 here, , think mvvmcross working on one--not sure if it's in there yet.
iphone monotouch
No comments:
Post a Comment