Custom TabItem in TabControl?

You will need to create a custom class derived from TabControl and override GetItemForContainerOverride to return your custom TabItem: protected override DependencyObject GetContainerForItemOverride() { return new CustomTabItem(); }.

It should like this in XAML, but I do not know how change default type of the output item created by TabControl while binding. I'd like to avoid it, bacause while creating CustomTabItem i'm creating complex View and it takes a while, so I don't want to create it always when something change in binded collection. My class extends typical TabItem and i'd like to use this class in TabControl instead of TabItem.

Code above generates error that Style cannot be applied to TabItem. But they are just styles for TabItem, so i'll still be missing my properties wchich I added in my custom class.

You will need to create a custom class derived from TabControl and override GetItemForContainerOverride to return your custom TabItem.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions