views:

598

answers:

1

Hi,

I've been playing with WPF and I'm not sure what I'm trying to do is possible. So is it possible to have a usercontrol describing a tabitem? I've tried but without success.

Right now I use user controls for the content but I would like to change that to be more generic.

A: 

You can:

1) Place a UserControl inside a TabItem:

<TabControl>
    <TabItem>
        <local:MyUserControl/>
    </TabItem>
</TabControl>

2) Inherit from TabItem rather than UserControl:

public class MyTabItem : TabItem { ... }

<TabControl>
    <local:MyTabItem/>
</TabControl>

HTH, Kent

Kent Boogaart