I was reading here: Microsoft Docs: TreeView and I found the property HasUnrealizedChildren that is perfect for my case as I have a TreeStructure that could be very deep and very complex. What I've not understood is how to use it in case of a databinding. In my case I have the same:
<muxc:TreeView Name="DessertTree"
SelectionMode="Multiple"
ItemsSource="{x:Bind DataSource}">
<muxc:TreeView.ItemTemplate>
<DataTemplate x:DataType="local:Item">
<muxc:TreeViewItem
ItemsSource="{x:Bind Children}"
Content="{x:Bind Name}"/>
</DataTemplate>
</muxc:TreeView.ItemTemplate>
</muxc:TreeView>
But I do not want to load all the Children, I want to load them only when expanded as explained in the example. But in order to show the Expand gliph I need to set HasUnrealizedChildren for the root items
Here is the trick:
I've used a Converter to change HasUnrealizedChildren to false once the item is loaded