3

I'm working on MVVMCross v3 and I want to create my own plugin, I followed this tutorial (which is for the vNext)

http://slodge.blogspot.fr/2012/10/build-new-plugin-for-mvvmcrosss.html

To be compatible for the v3 I changed IMvxServiceConsumer and GetService to Mvx.Resolve.

But on the tutorial there are :

Then, for WinRT, WindowsPhone and MonoTouch clients, you also need to provide a Loader accessor in setup.cs - like:

protected override void AddPluginsLoaders(Cirrious.MvvmCross.Platform.MvxLoaderPluginRegistry loaders)

{
    loaders.AddConventionalPlugin<MyCompany.MvvmCross.Plugins.Mega.WindowsPhone.Plugin>();

    base.AddPluginsLoaders(loaders);
}

How can I do that in v3?

Thanks

1
  • sorry - not sure you noticed that I did update the answer to the other question with some links.
    – Stuart
    May 28, 2013 at 9:22

1 Answer 1

4

If you want to write a new plugin, then :

For plugin initialisation, the nuget packages now do this via bootstrap files - e.g. see the files added for Location at:


The bootstrap way is the normal way to do initialisation now.

If you did want to use a non-bootstrap technique then you can do this:

  • In WinRT, WinPhone, and Droid, you don't need to use a loader, but you do need to call MyPlugin.PluginManager.Instance.EnsureLoaded before the plugin can be used.
  • In Touch, you would need to provide a loader during protected override void AddPluginsLoaders(MvxLoaderPluginRegistry loaders) - and you'd then still need to call EnsureLoaded() before the plugin can be used.

For examples of this 'old way' of working, see Setup.cs in the UI projects in https://github.com/slodge/MvvmCross-Tutorials/tree/master/Sample%20-%20TwitterSearch

2
  • Thanks, it works with the up to date sample :) Now If I want to move the project Sample.Plugin.Vibration.WindowsPhone into a simple folder in my Windows Phone app, it is possible?
    – Podelo
    May 28, 2013 at 10:16
  • 1
    That comment - moving a project into a folder in an app - makes zero sense to me. If a question is worth asking, please ask it properly - it'll save both of us time. Thanks :)
    – Stuart
    May 28, 2013 at 10:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.