Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF - TabItem Contents still visible when tabitem.visibility=hidden

Tags:

c#

.net

wpf

Is there any good solution to this problem.

I have set the

tabitem.visibility=hidden

but the contents in this tabitem is still visible. I want to hide all the contents of tabitems.

I did search for a resolution but no luck. In 2009 someone raised this issue but still NOW there is no result on how to achieve this. URL: http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/e4d23ace-0eb5-45a9-86f5-43c6351cb0ed/

Thanks

like image 964
aioracle Avatar asked Oct 18 '12 08:10

aioracle


1 Answers

To fix your problem use Visibility.Collapsed. Visibility.Hidden won't change the layout and so you would always have that empty space in the tab header. Be sure to change the selected tab as well when that happens.

I wouldn't recommend hiding tab items like that though. Conceptually they are either open or closed.

like image 104
MrDosu Avatar answered Oct 21 '22 18:10

MrDosu