开发者

Silverlight 4 closeable tabs in TabControl

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜