如何把扩展切换按钮在右边 [英] How to put Expander ToggleButton on right
问题描述
默认情况下,扩展为左对齐的切换按钮,但在我WPF应用程序,我想切换在标题的右侧按钮没有Expression Blend中的帮助。只是普通的XAML和/或C#。我的扩展包含有标签作为其子垂直定向的StackPanel。
By default the expander has a left aligned toggle button but in my WPF app i want toggle button on the right side of the header without the help of Expression Blend. just plain XAML and/or C#. My expander contains a vertically oriented stackpanel which has labels as its child.
我去了一部分,但的这里它说:展开控件没有任何命名的部分。
I went for its part but here it says "The Expander control does not have any named parts".
我找到了一个例子< A HREF =http://stackoverflow.com/questions/2587683/how-to-align-wpf-expander-control-toggle-button>此处。但它覆盖默认的扩展样式。
I found an example here. But it overrides the default Expander Style.
我觉得附加的图像应传达我想要什么。怎么做。任何一个环节将是有益的。
I think the attached image should convey what i want. How to do. Any link would be helpful.
推荐答案
使用这样的:
<Expander Header="Expander1" FlowDirection="RightToLeft">
<TextBlock FlowDirection="LeftToRight">
</TextBlock>
</Expander>
添加您的内容在的TextBlock
,如果你不希望的全部内容是从右到左。
Add your content in the TextBlock
, if you don't want to the whole content to be right to left.
这篇关于如何把扩展切换按钮在右边的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!