iphone - IMvxResourceLoader: How to use it (MvvmCross v2) -
what steps need followed use imvxresourceloader (mvvmcross v2) in our project. tried follows
public class aboutviewmodel : baseviewmodel, imvxserviceconsumer { private const string filename = "html/aboutapp.html"; public aboutviewmodel() { var resourceloader = this.getservice<imvxresourceloader>(); string helptext = resourceloader.gettextresource(filename); } }
but failed.
if remove lines inside aboutviewmodel(), app working fine.
if use these lines, not able display view model.
any suggestion? in advance.
in addition this
i trying initialise "resourceloader" plugin as
private void initialiseplugins() { cirrious.mvvmcross.plugins.location.pluginloader.instance.ensureloaded(); cirrious.mvvmcross.plugins.phonecall.pluginloader.instance.ensureloaded(); cirrious.mvvmcross.plugins.sms.pluginloader.instance.ensureloaded(); cirrious.mvvmcross.plugins.email.pluginloader.instance.ensureloaded(); cirrious.mvvmcross.plugins.resourceloader.pluginloader.instance.ensureloaded (); }
following error comming up. using mvvmcross v2.
cirrious.mvvmcross.exceptions.mvxexception: plugin not registered type cirrious.mvvmcross.plugins.resourceloader @ cirrious.mvvmcross.platform.mvxloaderbasedpluginmanager.loadplugin (system.type toload) [0x0003a] in /users/macbook2/employeeoffers_aug_05/cirrious/cirrious.mvvmcross/plugins/mvxloaderbasedpluginmanager.cs:38 @ cirrious.mvvmcross.plugins.mvxbasepluginmanager.exceptionwrappedloadplugin (system.type toload) [0x00000] in /users/macbook2/employeeavc_aug_05/cirrious/cirrious.mvvmcross/plugins/mvxbasepluginmanager.cs:49
plugin not registered
quite clear error message - suggests plugin isn't registered...
what's missing guess information plugin not registered - can debugger tell - e.g. asking debugger stop when mvxexception
s thrown.
my guess either file
or resourceloader
plugin (because resources relied on files in vnext/v2).
whichever is, make sure have platform-specific plugin referenced - phonecall
, location
, etc
aside> in v3 error surface in different way - service not found error when trying resolve file store @ runtime.
Comments
Post a Comment