XAM-Consulting / FreshMvvm.Maui

MIT License
44 stars 10 forks source link

Can't call ResolvePageModel #6

Closed rbrian closed 2 years ago

rbrian commented 2 years ago

I've got a new maui app, to which I've added FreshMvvm.Maui. I think I have everything configured the same as the sample app. However, when I call: var page = FreshPageModelResolver.ResolvePageModel<MainPageModel>();

I get an exception: ProtocolTracker.Pages.MainPage, ProtocolTracker, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null

Stack: ` 0xFFFFFFFFFFFFFFFF in Android.Runtime.JNIEnv.monodroid_debugger_unhandled_exception C# 0x14 in Android.Runtime.JNINativeWrapper._unhandled_exception at /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.cs:12,5 C# 0x1D in Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PP_V at /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.cs:23,26 C# 0x2B in FreshMvvm.Maui.FreshPageModelResolver.ResolvePageModel C# 0x12 in FreshMvvm.Maui.FreshPageModelResolver.ResolvePageModel C# 0x8 in FreshMvvm.Maui.FreshPageModelResolver.ResolvePageModel C# 0x1 in FreshMvvm.Maui.FreshPageModelResolver.ResolvePageModel C#

0x8 in ProtocolTracker.App..ctor at D:\GSProjects\ProtocolTracker\ProtocolTracker\App.xaml.cs:13,9 C# `

Same thing happens if I call a navigation method, e.g.

await CoreMethods.PushPageModel<ProtocolPageModel>(protocol);

Any ideas? Or any further info you need to narrow it down?

rbrian commented 2 years ago

Went through and cleaned up a couple bad namespaces resulting from moving pages & pagemodels around, and it works.