How to create a DataTemplate
in C# in a WinUI app, without having the template stored as a resource in XAML or loading from a XAML string (which is very slow)?
In WPF, it was possible using the VisualTree
property, but this does not exist in WinUI.
Please note I'm already aware of this question: How to programatically create a dataContext and assign a grid to it in c# (code behind) which does not answer mine