c# - How can I conditionally hide the TabPanel portion of a TabControl in its entirety? -


i've found lot of variations of question, conversation seems revolve around individual tabitems, , not tabpanel thing unto itself.

my main window has tabcontrol on it. tabs views. 1 of views special...a navigation display, whereas of others "sections" nav view can open.

what trying accomplish when user viewing nav view, tabs go away. i.e. hide whole tabpanel instead of having hide each tabitem one-by-one. while viewing other page, tabs show, easy movement between views.

i created question in response suggestion made on my other question.

the problem have tabpanel not seem have template can override in order datatrigger bound visibility property. closest have gotten plain old style.setter.

any suggestions on how after?

you provided answer - right combination use style datatrigger. trick define style targettype set {x:type tabpanel}, , put resource of tabcontrol - way style applied tabpanel (because it's implicit style). here's example:

<tabcontrol (...)>     <tabcontrol.resources>         <style targettype="{x:type tabpanel}">             <style.triggers>                 <datatrigger binding="{binding selectedindex, relativesource={relativesource ancestortype=tabcontrol}}"                              value="0">                     <setter property="visibility" value="collapsed" />                 </datatrigger>             </style.triggers>         </style>     </tabcontrol.resources>     (...) </tabcontrol> 

in example panel collapsed while first item selected.


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -