<DataTemplate>
<StackPanel Orientation="Vertical" Name="AddressStackPanel" >
<ComboBox Name="ComboBox" ItemsSource="{Binding Path=MatchedAddressList}" DisplayMemberPath="Address" SelectedIndex="0" SelectionChanged="ComboBox_SelectionChanged"/>
<TextBlock Name="InputtedAddress" Text="{Binding Path=InputtedAddress}" Foreground={Hopefully pass the UI element to the dataconverter } />
</StackPanel>
</DataTemplate>
ComboBox에는 가장 높은 점수 값이 선택된 지오 데이터베이스와 일치하는 주소가 있습니다. Textblock에는 일치하는 데 사용 된 사용자 입력 주소가 있습니다. 주소가 같으면 전경을 녹색으로, 그렇지 않으면 빨간색으로합니다.전체 UI 요소를 IValueConverter에 전달할 수 있습니까?
나는 전체 TextBlock을 dataconverter로 전달하고, 부모 StackPanel을 가져오고, 자식 0을 얻고, Combobox로 캐스팅하여 0 번째 요소를 얻은 다음 비교하여 빨간색 또는 녹색을 반환 할 수 있다고 생각했습니다. 이것이 가능합니까?
그렇지 않으면 난 그냥 못생긴 내가