8,757
社区成员
发帖
与我相关
我的任务
分享
<ComboBox Height="23" SelectedValue="{Binding Path=Supplier,Mode=TwoWay,ValidatesOnDataErrors=True, NotifyOnValidationError=True,ValidatesOnExceptions=True,ValidatesOnNotifyDataErrors=True}" SelectedValuePath="Supplier" HorizontalAlignment="Left" Margin="311,124,0,0" Name="comboBox_Supplier" VerticalAlignment="Top" Width="198"/>
<ComboBox Height="23" SelectedValue="{Binding Path=MotorcycleType,Mode=TwoWay,ValidatesOnDataErrors=True, NotifyOnValidationError=True,ValidatesOnExceptions=True}" SelectedValuePath="MotorcycleType" HorizontalAlignment="Left" Margin="311,159,0,0" Name="comboBox_CarType" VerticalAlignment="Top" Width="139" />
BindingExpression BE3 = this.comboBox_Supplier.GetBindingExpression(ComboBox.SelectedValueProperty);
BE3.UpdateSource();
BindingExpression BE4 = this.comboBox_CarType.GetBindingExpression(ComboBox.SelectedValueProperty);
BE4.UpdateSource();
<ComboBox Name="cbQTN" SelectedValue="{Binding QTN, Mode=TwoWay, ValidatesOnExceptions=true, NotifyOnValidationError=true}" SelectedValuePath="Value" DisplayMemberPath="Text" />
if ((object.ReferenceEquals(this.QTNField, value) != true))
{
this.ValidateProperty("QTN",value);
this.QTNField = value;
this.RaisePropertyChanged("QTN");
}
...
public void ValidateProperty(string memberName, object value)
{
Validator.ValidateProperty(value, new ValidationContext(this, null, null) { MemberName = memberName });
}
if (value== null || (object.ReferenceEquals(this.QTNField, value) != true))
{
this.ValidateProperty("QTN",value);
this.QTNField = value;
this.RaisePropertyChanged("QTN");
}