Please take a look at attached sample where I am trying to create tabitems dynamically and binding it to a view & viewmodel. I am also trying to set header of tab from the view but it does not update when I update in the text box of the view/viewmodel. Essentially header of tabitemex should be bind to the bound view's viewmodel property.
I have managed to achieve it, however, I need advice in terms of best practice for assigning styles. Is it better to create a "ControlTemplate" to be assigned to "Template" property in style or create a style and assign it at run time as done in attachment.
Solution is attached for your comments other if they are in similar situation.
One more question is why tabitems are not taking the theme of TabControl?
Thank you for contacting Infragistics. Adding styles to your tabs in code behind is just fine since you are not autogenerating your tabs. Please clarify which theme you want to use in your application. I do not see one assigned in your sample.
Let me know if you havea any additional questions regarding this matter.
Thank for the clarification.
I tried assigning IGTheme but when you add tab at run time you will notice its not exactly the same theme as in Infragistics Sample application.
Thank you for following up. I'll compare your sample with ours and I'll investigate and determine how to show the theme properly. In the meantime please let me know exactly which application you are referring to in our samples that you'd like to replicate.
Let me know if you have any questions.
If you open Samples browser for WPF application, go under xamTabControl -> Style -> Theming
Thank you for following up. You have to set the Theme property on the XamTabControl for the theme to take effect.
<igWPF:XamTabControl x:Name="MainTab" Theme="IGTheme"> </igWPF:XamTabControl>
Although your tabs are small in your sample, they do look like how they appear in our sample. Let me know if you have any questions regarding this matter.
<igWPF:XamTabControl x:Name="MainTab" Theme="IGTheme">