【发布时间】:2010-11-24 23:24:31
【问题描述】:
[Display(Name = "Type of Delivery:",
Description = "(TBC)")]
public string DeliveryType
{
get { return _deliveryType; }
set
{
Validator.ValidateProperty(value,
new ValidationContext(this, null, null)
{MemberName = CalculatorParameters.GetPropertyName()});
_deliveryType = value;
}
}
<ComboBox ItemsSource="{Binding ElementName=v_DeliveriesOrderedDomainDataSource, Path=Data}" SelectedItem="{Binding DeliveryType, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnExceptions=True}" DisplayMemberPath="Description" Margin="12,12"/>
这很好用,除了绑定的值是我的对象 v_DeliveriesOrdered 的 ToString(),但我想使用特定字段 即:值是“V_DeliveriesOrdered : {US,U.S.A. Port of Entry}”而我想使用值只是美国的字段代码
我该怎么办? (而不是取 '{' 和 ',' 之间的任何东西
【问题讨论】:
-
“使用特定值”你的意思是作为显示值吗?
-
是的,类似的
标签: silverlight data-binding combobox