Combobox Binding To Value
[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 开发者_StackOverflow社区ItemsSource="{Binding ElementName=v_DeliveriesOrderedDomainDataSource, Path=Data}" SelectedItem="{Binding DeliveryType, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnExceptions=True}" DisplayMemberPath="Description" Margin="12,12"/>
this works fine, except that the value bound is a ToString() of my object v_DeliveriesOrdered, but I would like to use a specific field ie: value is "V_DeliveriesOrdered : {US,U.S.A. Port of Entry}" whereas I would like to use the field code which value is just US
What should I do? (rather than taking whatever is inbetween the '{' and ','
so I replaced the DomainServices by a regular Silverlight WCF service, and the problem disappeared
精彩评论