ContentTemplate binding with a converter is not displaying the content
Posted: 12 Aug 2021, 17:01
I have a ContentPresenter and need to use a converter on the ContentTemplate binding. This converter returns a DataTemplate retrieved from a ResourceDictionary. It works fine in C#, but in C++ it is just displaying the viewmodel class name as text instead of the expected content. If I set the DataTemplate directly in the xaml, it works, so it seems there is an issue where the content is not being loaded correctly where a binding and converter is used.
Is this a known issue? I couldn't find anything that seemed to match in the bug tracker. If not, I will add a ticket for it.
Any suggestions on how to fix/workaround this issue would be greatly appreciated.
Code: Select all
<ContentPresenter Width="200" Height="200" Content="{Binding}" ContentTemplate="{Binding Data, Converter={StaticResource DataConverter}}"/>Any suggestions on how to fix/workaround this issue would be greatly appreciated.