1

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?

André Haupt
  • 3,294
  • 5
  • 32
  • 57
synergetic
  • 7,756
  • 8
  • 65
  • 106

3 Answers3

3

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

Community
  • 1
  • 1
André Haupt
  • 3,294
  • 5
  • 32
  • 57
  • I choose your answer correct without seeing details because I already took that root and achieved what I wanted. – synergetic Sep 22 '10 at 12:25
0

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

Denis
  • 4,115
  • 1
  • 18
  • 20
0

The following seems to be a solution:

http://blog.thekieners.com/2010/09/08/relativesource-binding-with-findancestor-mode-in-silverlight/

synergetic
  • 7,756
  • 8
  • 65
  • 106