我想选择改变项目的背景颜色,但我似乎无法找到一种方法来做到这一点。
我尝试使用下面的代码,但无法找到完成它,我需要到colror设置为自定义的,如“#8e8e8e”:ListBoxItem背景颜色
private void list_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (list.SelectedItem != null)
{
ListBoxItem a = sender as ListBoxItem;
//a.Background=
PhoneApplicationService.Current.State["test"] = list.SelectedItem;
NavigationService.Navigate(new Uri("/Detail", UriKind.Relative));
}
list.SelectedIndex = -1;
}
,所以我需要为了简单起见,将选定的项目背景色从ch#改为#8E8E8E,因为改变状态看起来有点复杂,特别是我需要做的就是改变所选项目的背景颜色。
由于提前,
见编辑的代码目前为止 – Ameen