Silverlight tabcontrol

Dec 9, 2010 at 9:57 PM

Hallo,

I am trying to use the Silverlight Tabcontrol in combination with Caliburn.Micro. In the XAML I bind the tabcontrol to the Items controls so that all the items in my conductor are added as a Tab. 

This approach results in the following exception thrown:

Unable to cast object of type 'XViewModel' to type 'System.Windows.Controls.TabItem'.

 

Is there a way to resolve this issue? 

Coordinator
Dec 9, 2010 at 10:04 PM

The TabControl in Silverlight is hopelessly broken for databinding. I have no idea why the SL team hasn't bothered to fix this despite all the complaints. As a result, I typically use a Horizontal ListBox (Tab) with a ContentControl (Tab Content) to simulate the same type of UI. If you search the forums, you'll probably find some further discussion on this.