I have my UWP
Application inherited from Base class, which inherits from MvxApplication<Setup, CoreApp>
:
public sealed partial class App : WindowsApplication
{
public App()
{
InitializeComponent();
}
}
public class WindowsApplication : MvxApplication<Setup, CoreApp>
{
}
public class Setup : MvxWindowsSetup<CoreApp>
{
public override IEnumerable<Assembly> GetViewAssemblies()
{
// need to do this as otherwise I receive the message that corresponding view to view model is not found
var assemblies = base.GetViewAssemblies().ToList();
assemblies.Add(typeof(Forms.App).Assembly);
return assemblies;
}
}
However, when launching it, receiving the following error message:
The type MvxContentPagePresentationAttribute is not configured in the presenter dictionary
As I understand, all that is not proper way to launch Xamarin.Forms
MvvmCross
application, as UWP App and Setup should be inherited from something like MvxFormsApplication
and MvxFormsWindowsSetup<CoreApp, Forms.App>
respectively (to have Xamarin.Forms app properly initialized).
But:
MvxFormsApplication
is not generic and doesn't provide ability of passing Forms-generic setup.- even if I inherit the App from
MvxFormsApplication
and usethis.RegisterSetupType<MvxFormsWindowsSetupInheritor>();
, Visual Studio compiler never allows me to compile the project because of some weird error message (something like The name “WindowsApplication” does not exist in the namespace “…”) (this might be some issue of Visual Studio, but I have VS 15.7 version, which expects the code to work (again, MvvmCross declares they support UWP and XF)).
So, from my understanding, if there is Xamarin.Forms app, there must be also some way of passing actually Xamarin.Forms App class to the UWP App class initialization.
MvvmCross, again, stands for UWP and Xamarin.Forms support, but I can't see any clear example of the way to setup such type of application.
MvvmCross documentation as always is quite "modest". There are some instructions about setting up MvvmCross UWP app as well as setting up MvvmCross XF iOS/Android, but the only word about MvvmCross XF UWP is:
You are now free to place your custom renderers in a different assembly. All you have to do to make it work is to add your assembly to the Setup.ViewAssemblies collection. (in official website docs) (which is still sounds weird, as iOS and Android versions don't need that additional code, which makes me think that such (current) documentation isn't quite actualized)
and
- UWP, WPF
- Extend App from MvxApplication. ( App : MvxApplication { } )
from MvvmCross.Forms
package readme.txt
file, when all other platforms, again, expect inheritance for the app classes from MvxForms*-based ones.
MvvmCross guys, any thoughts on that?