48

Closed

TabControl doesn't support DataBinding

description

TabControl does not:
  1. Generate TabItems.
  2. Have a ContentTemplate property.
  3. Have a ItemContainerStyle property.
     
    We're planning on fixing this in the Silverlight vNext timeline.
Closed Jun 8, 2011 at 10:20 PM by jeffwilcox
Closing as TabControl is actually not part of the toolkit. We have internal bugs on the control. Thanks!

comments

VictorG wrote Oct 19, 2009 at 8:51 PM

Need to get an AnimatedTabControl to work.

EisenbergEffect wrote Sep 16, 2010 at 6:20 PM

The following markup (from WPF) should work identically in the Silverlight TabControl:

<TabControl ItemsSource="{Binding Items}" SelectedItem="{Binding ActiveItem, Mode=TwoWay}">
<TabControl.ItemTemplate>
<DataTemplate>
...
</DataTemplate>
</TabControl.ItemTemplate>
<TabControl.ContentTemplate>
<DataTemplate>
...
</DataTemplate>
</TabControl.ContentTemplate>
</TabControl>

vorrtex wrote Mar 17, 2011 at 3:41 PM

I use my own extended tab control for the databinding functionality.
Here is example and code of the extended control, where I've answered another question:
http://stackoverflow.com/questions/4828661/silverlight-4-making-closeable-tabitems/4830314#4830314
It supports adding and removing items and markap is identical to wpf, except names for attributes (MyItemsSource instead of ItemsSource for example).