0

Yi-Lun Luo at Microsoft says:

[C]urrently [the] TabControl doesn't override PrepareContainerForItemOverride, so it won't automatically wrap your data source in TabItems.

So the question is: How do I create my own control that:

  1. Extends the TabControl.
  2. Overrides the PrepareContainerForItemOverride.
  3. Automatically wraps my data source in TabItems or my own TabItemExtended controls?
jedmao
  • 10,224
  • 11
  • 59
  • 65

2 Answers2

0

I've created the custom class which is derived from the Silverlight TabControl class. It supports data binding and works correctly with the ObservableCollection class. In my implementation I added the ItemsSource property with several other properties and handled changes of the source collection.

Here is the link: http://vortexwolf.wordpress.com/2011/04/09/silverlight-tabcontrol-with-data-binding/

vortexwolf
  • 13,967
  • 2
  • 54
  • 72
-1

There is a good example of a subclassed TabControl is the Prism RI. Make sure to look at Themes\generic.xaml and Shell.xaml for the templates.

Jeremiah Morrill
  • 4,248
  • 2
  • 17
  • 21