c# - MvvmCross resource loader plugin -
i try load xml resource mvxresourceloader plugin available on nuget.
steps made:
- downloaded plugin pcl , windows phone project.
- injected plugin viewmodel. (_loader)
added line:
_loader.getresourcestream("assets/suggestions.xml", delegate(stream stream) {...});
added resource windows phone project under correct path , set resource.
result:
the stream null. tried different versions of path.
it's hard tell exact situation is, there couple of working demos use resource plugin - , compare projects against these (although these may still stuck in winph7 winph8 handover may need love...):
- babel - jsonlocalisation - see https://github.com/slodge/mvvmcross-tutorials/tree/master/babel
- conference - sessions loaded json resources - see https://github.com/slodge/mvvmcross-tutorials/tree/master/sample%20-%20cirriousconference
also there's documentation available on: https://github.com/mvvmcross/mvvmcross/wiki/mvvmcross-plugins#wiki-resourceloader
for windowsphone, getresourcestream
implemented in https://github.com/mvvmcross/mvvmcross/blob/v3.1/plugins/cirrious/resourceloader/cirrious.mvvmcross.plugins.resourceloader.windowsphone/mvxwindowsphoneresourceloader.cs#l19 - loads content as:
var streaminfo = system.windows.application.getresourcestream(new uri(resourcepath, urikind.relative));
so, resources load when using system.windows
call? if do, plugin should work too.
Comments
Post a Comment