1
我有以下列表框:更改列表框中選擇的項目前景在Windows Phone 7的
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Margin="0,10,0,10">
<TextBlock
Foreground="Black"
Text="{Binding name}"/>
<TextBlock
Foreground="Black"
Text=": "
Visibility="{Binding
Path=name,
Converter={StaticResource ServiceOtherConverter}}"/>
<TextBlock
Foreground="Black"
Text="{Binding amount}"
Visibility="{Binding
Path=name,
Converter={StaticResource ServiceOtherConverter}}"/>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
而且我的應用程序有一個白色的背景,所以我想設置前景到黑色列表項。但是,當我選擇一個項目時,其前景不會改變,因爲它具有默認的前景。
如何將前景列表項目更改爲黑色,但仍然使所選前景不同?
你是什麼意思「右鍵點擊你的物品」?我可以右鍵單擊「對象和時間線」中的列表框,但不是一個項目。 – softarn
@softarn - 像這樣的東西應該會幫助你。 http://msdn.microsoft.com/en-us/expression/dd334538.aspx –