想要在expandderview右侧的标题中对齐文本。 这是我的代码:
<toolkit:ExpanderView HorizontalAlignment="Stretch">
<toolkit:ExpanderView.Header>
<TextBlock HorizontalAlignment="Right" Text="test"></TextBlock>
</toolkit:ExpanderView.Header>
</toolkit:ExpanderView>
但它保持不变。为什么呢?
答案 0 :(得分:0)
我认为你可以改变Header的宽度,并使用TextAlignment。就像这段代码一样。希望它对你有所帮助。
<toolkit:ExpanderView x:Name="ev" HorizontalAlignment="Stretch">
<toolkit:ExpanderView.Header>
<TextBlock Width="{Binding ActualWidth, ElementName=ev}" HorizontalAlignment="Stretch" TextAlignment="Right" Text="test"></TextBlock>
</toolkit:ExpanderView.Header>
</toolkit:ExpanderView>