WPF/XAML - compare the "SelectedIndex" of two comboboxes (DataTrigger?)
- by Luaca
hello,
i've got two comboboxes with the same content. the user should not be allowed to choose the same item twice. therefore the comboboxes' contents (= selectedindex?) should never be equal.
my first attempt was to comapare the selectedindex with a datatrigger to show/hide a button:
<DataTrigger Binding="{Binding ElementName=comboBox1, Path=SelectedIndex}" Value="{Binding ElementName=comboBox2, Path=SelectedIndex}">
<Setter Property="Visibility" Value="Hidden" />
</DataTrigger>
it seems that it is not possible to use Value={Binding}. is there any other way (if possible without using a converter)? thanks in advance!