2
我正在使用Microsoft Surface SDK,並且遇到樣式選定項目的麻煩。SurfaceListBox所選項目模板
到目前爲止,我有:
<s:SurfaceListBox Name="listy" Background="Transparent"
FontSize="50" Foreground="White" BorderBrush="White"
HorizontalContentAlignment="Center"
Margin="5,5,5,100" SelectionMode="Single">
<s:SurfaceListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding}" Foreground="White" />
</DataTemplate>
</s:SurfaceListBox.ItemTemplate>
<s:SurfaceListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBoxItem}">
<ContentPresenter HorizontalAlignment="Center" />
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="Grey" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</s:SurfaceListBox.ItemContainerStyle>
</s:SurfaceListBox>
但是失敗了,有沒有教程這在所有在互聯網上 - 我搜索小時。
感謝您的幫助!
查找教程造型的正常列表框控件。相同的代碼將在Surface上運行。 – 2011-02-25 15:05:54