开发者

Silverlight 4 closeable tabs in TabControl

开发者 https://www.devze.com 2023-01-16 07:09 出处:网络
I have close button in the header of eac开发者_C百科h 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-bu

I have close button in the header of eac开发者_C百科h 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?


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


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


The following seems to be a solution:

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

0

精彩评论

暂无评论...
验证码 换一张
取 消