public void Attach(PropertyViewItem property, PropertyItem info)
{
var binding = new Binding("Value")
{
Mode = BindingMode.TwoWay,
Source = info,
ValidatesOnExceptions = true,
ValidatesOnDataErrors = true
};
BindingOperations.SetBinding(combo, ComboBox.SelectedItemProperty, binding);
dynamic list = info.Value;
foreach (dynamic v in list)
{
combo.Items.Add(v);
}
combo.SelectedIndex = 0;
} |