MvvmCross9.0.2 throws System.NullReferenceException for Bind
See original GitHub issue🐛 Bug Report
System.NullReferenceException: “Object reference not set to an instance of an object.”
at MvvmCross.Binding.BindingContext.MvxBaseFluentBindingDescription1.SourcePropertyPath[TSource](Expression
1 sourceProperty)\n
at MvvmCross.Binding.BindingContext.MvxFluentBindingDescription2.To(Expression
1 sourceProperty)
Note:MacOS App migrated from Xamarin.Mac to. NET6
Expected behavior
MacOS App starts up normally
Reproduction steps
Create binding set and call bind.
Sample Source Code: MvvmCross.NETSample.Mac.zip
Configuration
・Visual Studio for Mac 17.5 ・MvvmCross 9.0.2
Platform:
- 📱 iOS
- 🤖 Android
- 🏁 WPF
- 🌎 UWP
- 🍎 MacOS
- 📺 tvOS
- 🐒 Xamarin.Forms
Issue Analytics
- State:
- Created 9 months ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
NullReference exception during binding with MvvmCross
I ran into the same problem using Views generated from code. The Viewmodel is set, but the bindingcontext is not completely set. Here...
Read more >Upgrade to 8.0.2 throws System.ReferenceNullException ...
Throws System.ReferenceNullException "Object reference not set to an instance of object" for setting bind after CreatBindingSet() ...
Read more >NullReferenceException when building Xamarin Android ...
I've been trying to build a Xamarin Android Binding Library having a .jar file in it. It builds just as expected with different...
Read more >Why am I getting a null reference exception for ASP.NET ...
Normally, we bind all "Applicant model" details to the Applicant view page, and some fields have data while others do not. It should...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@dingyud it looks like you hit by this bug https://github.com/MvvmCross/MvvmCross/issues/4572 Try to set any of presentation attributes (I suppose, the
[MvxWindowPresentation]
will be the best here) explicitly to your view / view controller to workaround this.Seems like what is happening is that you have your standard Main.storyboard, which shows the ViewControler before MvvmCross has initialized. So it is not MvvmCross pushing the ViewController.