WPF 中的 Expander
控件不会拉伸(stretch)以填充所有可用空间。 XAML 中是否有针对此的任何解决方案?
最佳答案
您需要做的就是:
<Expander>
<Expander.Header>
<TextBlock
Text="I am header text..."
Background="Blue"
Width="{Binding
RelativeSource={RelativeSource
Mode=FindAncestor,
AncestorType={x:Type Expander}},
Path=ActualWidth}"
/>
</Expander.Header>
<TextBlock Background="Red">
I am some content...
</TextBlock>
</Expander>
http://joshsmithonwpf.wordpress.com/2007/02/24/stretching-content-in-an-expander-header/
关于c# - 如何制作 WPF Expander Stretch?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/680498/