Resize ElementHost to size of the hosted XAML UserControl

后端 未结 2 863
攒了一身酷
攒了一身酷 2021-02-11 06:01

I would like an expanding panel in my Windows Forms app. I was having a look to see if this would be possible using the WPF Expander control. I\'ve created a Xaml UserControl wh

2条回答
  •  爱一瞬间的悲伤
    2021-02-11 07:05

    Is there any particular reason you are inheriting from Expander vs. just using an Expander in your UI?

    If you set up the H/V Alignment properties of the Expander, you should be able to get most standard sizing behaviors without having size triggers. From my experience, the content portion of the Expander automatically sizes to fit.

    If you're trying to completely remove the header part, then you might look at making your own ControlTemplate for the Expander.

提交回复
热议问题