Repository navigation
MAUI - XAML - Object reference not set to an instance of an object. #8268
DescriptionError Object reference not set to an instance of an object. MauiApp1 E:\Win10\M\MobileApps\MauiApp1\MainPage.xaml 1 Steps to ReproduceTested in vs2022 17.2. (latest preview ) I am trying to convert this repo (https://github.com/kphillpotts/IcelandMoss) into MAUI project. But finally, I am facing some weird issues as attached below. I could not able to solve this error. I am breaking my head since I am a newbie to MAUI so please advise what I am doing wrong here ( source code attached ) Thanks Version with bug6.0 Release Candidate 2 or older Last version that worked wellUnknown/Other Affected platformsAndroid, Windows Affected platform versionsAndroid Emulator ( API 23) , Windows Did you find any workaround?nope, I am a newbie. The error, Relevant log outputSeverity Code Description Project File Line Suppression State
Error Object reference not set to an instance of an object. MauiApp1 E:\Win10\M\MobileApps\MauiApp1\MainPage.xaml 1 |
Replies: 3 comments 1 reply
This comment was marked as off-topic.
This comment was marked as off-topic.
|
@SaddamBInSyed The problem is your DataTrigger. It reference to an unkown Control <Border.Triggers>
<DataTrigger
Binding="{Binding ShoppingCart.ItemCount}"
TargetType="pancake:PancakeView"
Value="0">
<Setter Property="IsVisible" Value="False" />
</DataTrigger>
</Border.Triggers>Add a reference to "pancake:" in your XAML file header (you need to find the MAUI counterpart for this), or remove the trigger xmlns:pancake="clr-namespace:Xamarin.Forms.PancakeView;assembly=Xamarin.Forms.PancakeView"https://github.com/kphillpotts/IcelandMoss/blob/master/src/IcelandMoss/IcelandMoss/MainPage.xaml#L11 Or, add Then, it will built. |

@SaddamBInSyed
This is not an issue of MAUI, but your code.
I checked your project and found the root cause.
The problem is your DataTrigger. It reference to an unkown Control
pancake:PancakeView.Add a reference to "pancake:" in your XAML file header (you need to find the MAUI counterpart for this), or remove the trigger
https://gi…