开发者

WPF Expander - Can't see the internal controls in Visual Studio 2010 Design window

开发者 https://www.devze.com 2022-12-20 20:03 出处:网络
I\'m using Visual Studio 2010 and in a WPF app I\'m using an expander. The prob is that the GroupBox etc inside the Expander are hidden from view in the Design window.

I'm using Visual Studio 2010 and in a WPF app I'm using an expander. The prob is that the GroupBox etc inside the Expander are hidden from view in the Design window.

Any ideas to开发者_C百科 have them show?

Thx!


Well, this is old post so Gregg might already have answer to this. But, I'd like post answer because this might help others who stumbled across this issue.

The reason for expander not expanded in design view of VS 10 is that it's styled with user defined style like this:

  <Expander Header="Layout"           
            IsExpanded="True" 
            Style="{StaticResource ExpanderStyle_Normal}"> 
  </Expander>  

So, there are two solutions:

  1. Either, remove the Style attribute.

or/better

  1. Set the Visibility to "Visible" in contentpresenter of controltemplate of that style.

    < ContentPresenter Visibility="Visible" />

Note: Both workarounds are only meant for designing phase so when you're done with it, you need to revert back to the setting that's needed for the run-time.

0

精彩评论

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

关注公众号