У меня есть следующий код C # в файле .cs, и я хочу переместить его в XAML.код включает в себя свойство: OperationConverte
Binding binding1 = new Binding("DisplayNames")
{
Source = OperationConverter,
};
ComboBox4.SetBinding(ComboBox.ItemsSourceProperty, binding1);
Binding binding2 = new Binding("Operation")
{
Mode = BindingMode.TwoWay,
Converter = (OperationConverter as IValueConverter)
};
ComboBox4.SetBinding(ComboBox.SelectedValueProperty, binding2);
Итак, я сделал следующее:
<ComboBox Name="ComboBox4" MinWidth="100" ItemsSource="{Binding Path=OperationConverter.DisplayNames}"
SelectedValue="{Binding Path=Operation, Mode=TwoWay,
Converter={?????DONT KNOW WHAT TO DO HERE????}}" Margin="30,123,83,148" />
, но я не понимаю, как подключить OperationConverter