Hi there
How do I binding a collection of WorkspaceViewModels with a XamTabControl?
What I want to do is to specify the DataTemplates for the ViewModels in the resource section and bind the ItemsSource property of the tab control to the ViewModelCollection.
Can this be done?
Thanks
-Rushui
Hello Rashui,
Thank you for your post. I have been looking into it and if I understand correctly, you wish to show different template for the selected tab, based on the data that the selected tam contains. If this is correct, I can suggest creating a DataTempalteSelector and use it to the ContentTempalte property of the xamTabControl. I have created a sample application for you, that shows how you can show two different templates for the selected tab of the XamTabControl.
Please let me know if you need any further assistance on the matter.
Sincerely,
Krasimir
Developer Support Engineer
Infragistics
www.infragistics.com/support
Thanks Krasimir. That's what I am looking for. Unfortunitely, the solution suffers the same problem with the WPF stock TabControl. When using it with the DataTemplates, the tab control seems to rebuild the tab each time the tab is selected. You can tell because the UI state of the tab content is lost. Losing the state is one issue, the second issue is that tabs with larget amount of content will take some time to build.
I think I will just do it the old fashion way and add the TabItemEx objects in the code behind file.
Thanks for you help
Hello Rushui,
Thank you for your reply. Please let me know if you need any further assistance on the matter.