views:

206

answers:

3

I have close button in the header of each tab of TabControl. Tabs are created dynamically in code and a datatemplate (in which the close button was defined) is applied. Now I want close-buttons to be visible only when tab is active. Is it possible to bind button's visibility property to tabitem's activeness (probably IsSelected property)? How?

A: 

It would be easier to achieve if you put close button in TabHeader template instead of datatemplate.

Denis
Actually a datatemplate is applied as HeaderTemplate.
synergetic
+1  A: 

Have a look Kent's solution. There's also some sample code on his blog.

Andy
I choose your answer correct without seeing details because I already took that root and achieved what I wanted.
synergetic
sweet, thanks allot
Andy