다시 간단한 질문입니다. ListBoxItems (그냥 일반 텍스트)로드 된 ListBox Windows 8 전화 응용 프로그램이 있습니다. 나는 XAML에서 흰색으로 텍스트의 전경색을 설정ListBox isSelected 메서드가 텍스트 스타일을 변경합니다.
<ListBox x:Name="L1" Foreground="white">
내가리스트 박스의 selectedIndex 속성, 빨간색으로 전경의 변화를 호출하면. 내가 xaml 또는 C#으로 설정했는지 여부는이 작업을 수행합니다. 나는 시도하고 selectedIndex의 호출 된 후 수동으로 색상을 변경 C#에서 코드를 추가하는 경우, 그것은 여전히 ...
tempListBoxItem = listBoxPicType.SelectedItem as ListBoxItem;
tempListBoxItem.Foreground = //some color that isn't red
이 주위에 얻을 수있는 가장 간단한 방법은 무엇을 작동하지 않는 이유는 무엇입니까? TIA
가능한 복제본 [WP7 ListBox 선택한 항목이 색상을 변경하지 않습니다] (http://stackoverflow.com/questions/20003028/wp7-listbox-selected-item-is-not-changing-the-color) –
제목에서 태그를 제거했습니다. 대부분의 경우 [제목에 제목을 넣으면 안됩니다] (http://meta.stackexchange.com/questions/19190/should-questions-include-tags- in-their-titles). – Romasz