Binding string Dependency Property to datatemplate
Posted: 27 Oct 2024, 14:11
I have a ResourceDictionary define in a different xaml, in it there are data templates that are then used to be set in a Button ContentTemplate like this:
ContentTemplate="{DynamicResource DataTemplateMicroscope}">
I would like to Bind the DynamicResource name string to a parameter or some private member from the CPP code with a Noesis::DependencyProperty* Button3TypeProperty for example.
I was not able to convert a string such "Microscope" to the actual data template to dynamically determine which datatemplate will be used.
Any suggestions?
ContentTemplate="{DynamicResource DataTemplateMicroscope}">
I would like to Bind the DynamicResource name string to a parameter or some private member from the CPP code with a Noesis::DependencyProperty* Button3TypeProperty for example.
I was not able to convert a string such "Microscope" to the actual data template to dynamically determine which datatemplate will be used.
Any suggestions?