如何更改选择,在列表框中拥有的DataTemplate中的Windows Phone项目的背景颜色?
我已经看到,它可以与setter属性。 在那里,我把它们写?
谢谢。
码
<ListBox x:Name="listLocs" HorizontalAlignment="Left" Height="605" VerticalAlignment="Top" Width="250" SelectionChanged="listLocs_SelectionChanged" Margin="10,155,0,0" BorderBrush="#FF030042" BorderThickness="2" Foreground="#FF030042">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<StackPanel>
<Image Source="/Images/Pin2.png" Width="60" Height="60" />
</StackPanel>
<StackPanel>
<StackPanel>
<TextBlock x:Name="txtName" Margin="10,0,0,0" Foreground="#FF030042" FontSize="30" Text="{Binding Name}"/>
</StackPanel>
<StackPanel>
<TextBlock x:Name="txtDescription" Margin="10,0,0,0" Foreground="#FF030042" FontSize="20" Text="{Binding Description}"/>
</StackPanel>
</StackPanel>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>