c# - Can't start a simple view with MVVMCross Xamarin IOS -
please help!
just spend more 8 hours trying 1 simple view presented in ios, not working. no idea whats going on.
this code. setup.cs
public class setup : mvxiossetup { public setup(mvxapplicationdelegate applicationdelegate, uiwindow window) : base(applicationdelegate, window) { } public setup(mvxapplicationdelegate applicationdelegate, imvxiosviewpresenter presenter) : base(applicationdelegate, presenter) { } protected override void initializeioc() { base.initializeioc(); mvx.registersingleton<ilanguageservice>(() => new languageservice()); mvx.registersingleton<isoundplayerservice>(() => new soundplayerservice()); mvx.registersingleton<ialertservice>(() => new alertservice()); mvx.registersingleton<itagmanagerservice>(() => new tagmanagerservice()); mvx.registersingleton<ibackcompatservice>(() => new backcompatservice()); mvx.registersingleton<iplatformservice>(() => new platformservice()); } protected override imvxapplication createapp() { return new app(); } protected override imvxtrace createdebugtrace() { return new debugtrace(); } }
appdelegate.cs
[register("appdelegate")] public partial class appdelegate : mvxapplicationdelegate { public override uiwindow window { get; set; } public override bool finishedlaunching(uiapplication app, nsdictionary options) { window = new uiwindow(uiscreen.mainscreen.bounds); var presenter = new mvxiosviewpresenter(this, window); var setup = new setup(this, presenter); setup.initialize(); var startup = mvx.resolve<imvxappstart>(); startup.start(); window.makekeyandvisible(); return true; } }
splashview
public partial class splashview : mvxviewcontroller { public splashview() : base("splashview", null) { } public override void viewdidload() { base.viewdidload(); var set = this.createbindingset<splashview, splashviewmodel>(); set.apply(); } public new splashviewmodel viewmodel { { return (splashviewmodel)base.viewmodel; } set { base.viewmodel = value; } } }
now error i'm getting when run is: mvvmcross.platform.exceptions.mvxexception: failed construct , initialize viewmodel type splashviewmodel locator mvxdefaultviewmodellocator - check innerexception more information
Comments
Post a Comment