In MvvmCross there's MvxAppCompatSetup and MvxAppCompatSetup<TApplication> (which actually derives from MvxAppCompatSetup). Both are implemented in the MvxAppCompatSetup.cs file.
I really can't imagine when one would use only MvxAppCompatSetup instead of MvxAppCompatSetup<TApplication> as to my understanding one would always have the TApplication - that's actually the App that's defined in the Core project.
I am curious though: When would using the non-generic version MvxAppCompatSetup make sense / why is it there?
The code for the generic and non-generic version from the MvxAppCompatSetup.cs file:
public abstract class MvxAppCompatSetup : MvxAndroidSetup
{
protected override IEnumerable<Assembly> AndroidViewAssemblies =>
new List<Assembly>(base.AndroidViewAssemblies)
{
typeof(Toolbar).Assembly,
typeof(DrawerLayout).Assembly,
typeof(MvxSwipeRefreshLayout).Assembly
};
protected override IMvxAndroidViewPresenter CreateViewPresenter()
{
return new MvxAppCompatViewPresenter(AndroidViewAssemblies);
}
protected override void FillTargetFactories(IMvxTargetBindingFactoryRegistry registry)
{
MvxAppCompatSetupHelper.FillTargetFactories(registry);
base.FillTargetFactories(registry);
}
protected override void FillBindingNames(IMvxBindingNameRegistry registry)
{
MvxAppCompatSetupHelper.FillDefaultBindingNames(registry);
base.FillBindingNames(registry);
}
}
public class MvxAppCompatSetup<TApplication> : MvxAppCompatSetup
where TApplication : class, IMvxApplication, new()
{
protected override IMvxApplication CreateApp() => Mvx.IoCProvider.IoCConstruct<TApplication>();
public override IEnumerable<Assembly> GetViewModelAssemblies()
{
return new[] { typeof(TApplication).GetTypeInfo().Assembly };
}
}