I've learned that once the UI controls are instantiated, it is impossible to convert back to a DataTemplate
i.e. FrameworkElementFactory
tree.
Convert UIElement to DataTemplate
-
11-12-2021 - |
Question
I have a DataTemplate
defined in XAML. I want to customize it and give it to DataGridTemplateColumn.CellTemplate
. But when I call LoadContent()
, the VisualTree
is still null, instead a UIElement
tree is returned. After I customize the tree, how can I convert it back to a DataTemplate
? Or is there a way to feed the DataGrid
cells directly with UIElement
?
Solution 2
OTHER TIPS
I think it should help you
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow