MvvmCross.Plugin.PictureChooser v4.4.0 unresolved for UWP app

166 views Asked by At

I am building a set of mobile apps using Xamarin.Forms with MvvmCross 4.4.0. When I try to start the UWP version of the app, I get the error: "Failed to construct and Initialize ViewModel for type xxx'. Looking into the exception I see: "Failed to resolve parameter pictureChooser of type IMvxPictureChooserTask when creating xxx'. With the other platform-specific projects, I see a MvvmCross.Plugin.PictureChooser' reference as well as a MvvmCross.Plugin.PictureChooser.Droid (or iOS) reference. In the UWP app there is only the base reference.The UWP app targets Windows 10 (10.0; Build 10240). There is no PictureChooserPluginBootstrap file either. Not sure how to resolve this.

1

There are 1 answers

1
johnslaby On

Following a similar post with the Messanger plugin, I first tried modifying setup.cs with a pluginloader override, but the 'WindowsStore' namespace was unresolved. I then created a bootstrap file and, for whatever reason, the WindowsStore.Plugin namespace is OK. Here's the code:

using MvvmCross.Platform.Plugins;

namespace My.Name.Space.UWP.Bootstrap
{
    public class PictureChooserPluginBootstrap
        :  MvxLoaderPluginBootstrapAction<MvvmCross.Plugins.PictureChooser.PluginLoader, MvvmCross.Plugins.PictureChooser.WindowsStore.Plugin>
    {
    }
}