【发布时间】:2014-12-09 08:59:56
【问题描述】:
我正在使用 Toolkit for Windows Phone 中的 ExpanderView。我添加的是每个标题下方的行。我不能做的是为可扩展的标题拉伸线。
<toolkit:ExpanderView x:Name="ev" HorizontalAlignment="Stretch" Margin="0,0,0,8"
Header="{Binding}"
NonExpandableHeader="{Binding}"
Expander="{Binding}"
ItemsSource="{Binding}"
IsNonExpandable="{Binding HasSingleMessage}">
<toolkit:ExpanderView.HeaderTemplate>
<DataTemplate>
<StackPanel>
<TextBlock Text="{Binding LastMessageReceived.Header}"
HorizontalAlignment="Stretch"
Foreground="Black"
FontSize="{StaticResource PhoneFontSizeLarge}"
FontFamily="{StaticResource PhoneFontFamilySemiLight}"/>
<Rectangle Height="1" StrokeThickness="0" Fill="Black" Margin="0,8" />
</StackPanel>
</DataTemplate>
</toolkit:ExpanderView.HeaderTemplate>
【问题讨论】:
-
你的意思是,你必须把红圈下面的线拉到
Deviation 01 Test下面吗? -
我不会添加它作为答案,因为我不知道它是否会起作用,但尝试在 ExpanderView 声明中添加
HorizontalContentAlignment="Stretch"。那么请让我知道它是否有效。 -
Test av Kategorier 和 Avvik Lager 下的那一行。现在它和标题一样大,但我想像 Deviation 01 Test 一样将它拉伸到屏幕宽度。
-
添加 HorizontalContentAlignment="Stretch" 无效。测试 av Kategorier 和 Avvik Lager 仍然拉伸到标题宽度。
标签: c# xaml windows-phone-7 windows-phone-8 silverlight-toolkit