I'm doing a generic controller, right now is one Radbutton with two different datatemplates. Each dataTemplate has an specific key and in code-behind i will change between them.
My problem is i cannot do the binding to my properties. For example:
My Xaml looks like:
and in c# when i wanna change the datatemplate i do something like this:
My button class will inherit from the RadButton, and every property is defined there (like ImageSource or DefaultOkText of the image binding in the Xaml i post).
But when i use this controller, with for example the Standard datatemplate, the image (from ImageSource) doesn't show, but the Text from the textblock shows. The same happens when i change for the OK datatemplate (in this case will not put anything because the binding of ImageOkSource or DefaultOkText will not do).
What can i do to get this working?