Describe the bug
Application crashes on all platforms.
To Reproduce
Steps to reproduce the behavior:
Create a new .NET 9 RC1 MAUI project
Add the Maui.DataGrid nuget
Initialize it in some XAML.
Expected behavior
To not crash the application
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
OS: All OSes
Version: DataGrid 4.0.4
Stack Trace
[0:] [13:46:57 FTL] Inner Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Maui.Controls.Xaml.BindingExtension.<Microsoft.Maui.Controls.Xaml.IMarkupExtension<Microsoft.Maui.Controls.BindingBase>.ProvideValue>g__CreateBinding|40_0(<>c__DisplayClass40_0& ) in /_/src/Controls/src/Xaml/MarkupExtensions/BindingExtension.cs:line 46
at Microsoft.Maui.Controls.Xaml.BindingExtension.Microsoft.Maui.Controls.Xaml.IMarkupExtension<Microsoft.Maui.Controls.BindingBase>.ProvideValue(IServiceProvider serviceProvider) in /_/src/Controls/src/Xaml/MarkupExtensions/BindingExtension.cs:line 27
at Maui.DataGrid.DataGrid.InitializeComponent() in D:\Maui.DataGrid\Maui.DataGrid\Microsoft.Maui.Controls.SourceGen\Microsoft.Maui.Controls.SourceGen.CodeBehindGenerator\DataGrid.xaml.sg.cs:line 53
at Maui.DataGrid.DataGrid..ctor() in D:\Maui.DataGrid\Maui.DataGrid\DataGrid.xaml.cs:line 46
at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Constructor(Object obj, IntPtr* args)
at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
The issues are likely related to the mandatory compile time bindings in .NET 9. I see usages of x:DataType={x:Object} in the library, and this is no longer allowed in .NET 9. If this is the issue, a simple solution could be using reflection based bindings with x:DataType={x:Null}
Describe the bug Application crashes on all platforms.
To Reproduce Steps to reproduce the behavior:
Expected behavior To not crash the application
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Stack Trace
The issues are likely related to the mandatory compile time bindings in .NET 9. I see usages of
x:DataType={x:Object}
in the library, and this is no longer allowed in .NET 9. If this is the issue, a simple solution could be using reflection based bindings withx:DataType={x:Null}