The 'convention' part is simply the naming convention.
i.e. it's just looking for something that will provide an IMvxPlugin for:
Cirrious.MvvmCross.Plugins.Visibility
using the rule 'add "WindowsPhone"' to get:
Cirrious.MvvmCross.Plugins.Visibility.WindowsPhone.Plugin
If the rule changes for WP8... then we can just change the convention in https://github.com/slodge/MvvmCross/blob/vnext/Cirrious/Cirrious.MvvmCross.WindowsPhone/Platform/MvxBaseWindowsPhoneSetup.cs
While WP8 is still a bit unclear... You can do this yourself in your project in your Setup.cs using code like:
protected override IMvxPluginManager CreatePluginManager() { var toReturn = new MvxLoaderBasedPluginManager(); var registry = new MvxLoaderPluginRegistry(".WP7",toReturn.Loaders); AddPluginsLoaders(registry); return toReturn; }
or you could even mix and match versions - i.e. you could do something like:
protected override IMvxPluginManager CreatePluginManager() { var toReturn = new MvxLoaderBasedPluginManager(); var sharedRegistry = new MvxLoaderPluginRegistry(".WindowsPhone",toReturn.Loaders); sharedRegistry.AddConventionBasedPlugin<SharedP1>(); sharedRegistry.AddConventionBasedPlugin<SharedP1>(); sharedRegistry.AddConventionBasedPlugin<SharedP3>(); var wp7Registry = new MvxLoaderPluginRegistry(".WP7",toReturn.Loaders); wp7Registry.AddConventionBasedPlugin<WP7P1>(); wp7Registry.AddConventionBasedPlugin<WP7P2>(); return toReturn; }
Finally, there's nothing forcing you to use conventions at all - you can always just provide your own plugin loading methods providing Func<IMvxPlugin> - e.g.
protected override IMvxPluginManager CreatePluginManager() { var toReturn = new MvxLoaderBasedPluginManager(); toReturn.Loaders.Add('Cirrious.MvvmCross.Plugins.Visibility.WindowsPhone.Plugin', () => { // do whatever code you want to do... return thePlugin; }); return toReturn; }
You can mix and match these techniques
Alternatively, you can provide a totally new implementation of IMvxPluginManager if you want to. The interface is just:
public interface IMvxPluginManager { bool IsPluginLoaded<T>() where T : IMvxPluginLoader; void EnsureLoaded<T>() where T : IMvxPluginLoader; }
So, you could, for example provide a very simply manager like
public class SimplePluginManager : IMvxPluginManager { public SimplePluginManager() { // load the plugins your app needs here! Cirrious.MvvmCross.Plugins.Visibility.Wp7.Plugin.Load(); Cirrious.MvvmCross.Plugins.Color.WindowsPhone.Plugin.Load(); } public bool IsPluginLoaded<T>() where T : IMvxPluginLoader { return true; } public void EnsureLoaded<T>() where T : IMvxPluginLoader { } }