다음 질문이 있습니다. 내보기 모델에서 이름 및 값, 두 문자열 속성이있는 개체 목록이 있습니다. 내보기에서 목록을 콤보 상자에 바인딩하고 싶지만 특정 이름을 가진 요소 만 표시하려고합니다. 목록은 :목록의 특정 요소를 콤보 상자에 바인딩
이름 및이 & nbsp이 & nbsp이 & nbsp nbspValue
foo는 &이 & nbsp이 & nbsp이 & nbsp nbspaaa
바 &이 & nbsp이 & nbsp이 & nbsp nbspbbbb
foo는 &이 & nbsp이 & nbsp이 & nbsp nbspccc
. 여기서 catch는 코드 숨김 또는 viewmodel이 아닌보기에서 필터를 수행하려고합니다.
ViewCode :
<ComboBox IsEditable="True" VerticalAlignment="Top"
HorizontalAlignment="Left" Width="150" Margin="60,60,0,0"
ItemsSource="{Binding Elements}"
SelectedValue="{Binding Value}" SelectedValuePath="Value"
DisplayMemberPath="Value" />
뷰 모델 번호 :
private List<CustomChartElement> elements;
public List<CustomChartElement> Elements
{
get { return this.elements; }
}
관련 코드 및 XAML을 게시하십시오. 'CollectionView'를 사용하십시오. –
@ HighCore. 내 코드는이 질문과 관련이 없습니다. – darkArk
"StackOverflow 지침에 따라"해당 문제에 대한 최소한의 이해를 보여 주어야합니다 .... " 적어도 이미 시도한 것을 보여줄 필요가 있습니다. –