Closed nikolaykusch closed 2 years ago
I got the problem. ItemsSource is null for the first render. I prevented rendering if ItemSource is null with this pr: https://github.com/enisn/TreeView.Maui/pull/2
I've updated the demo and it's working well now
Yes, it works. Thank you.
Here details of error
System.NullReferenceException HResult=0x80004003 Message=Object reference not set to an instance of an object. Source=Microsoft.Maui.Controls.Xaml StackTrace: at Microsoft.Maui.Controls.Xaml.ApplyPropertiesVisitor.SetPropertyValue(Object xamlelement, XmlName propertyName, Object value, Object rootElement, INode node, HydrationContext context, IXmlLineInfo lineInfo) at Microsoft.Maui.Controls.Xaml.ApplyPropertiesVisitor.Visit(ElementNode node, INode parentNode) at Microsoft.Maui.Controls.Xaml.ElementNode.Accept(IXamlNodeVisitor visitor, INode parentNode) at Microsoft.Maui.Controls.Xaml.ElementNode.Accept(IXamlNodeVisitor visitor, INode parentNode) at Microsoft.Maui.Controls.Xaml.ElementNode.Accept(IXamlNodeVisitor visitor, INode parentNode) at Microsoft.Maui.Controls.Xaml.RootNode.Accept(IXamlNodeVisitor visitor, INode parentNode) at Microsoft.Maui.Controls.Xaml.XamlLoader.Load(Object view, String xaml, Assembly rootAssembly, Boolean useDesignProperties) at Microsoft.Maui.Controls.Xaml.XamlLoader.Load(Object view, Type callingType) at Microsoft.Maui.Controls.Xaml.Extensions.LoadFromXaml[TXaml](TXaml view, Type callingType) at TDriveMAUI.View.Controls.Main.LeftPane.TreeView.InitializeComponent() in C:...\Microsoft.Maui.Controls.SourceGen\Microsoft.Maui.Controls.SourceGen.CodeBehindGenerator\View_Controls_Main_LeftPane_TreeView.xaml.sg.cs:line 22