日期:2014-05-17 浏览次数:20966 次
set,而是调用
{
if (userinfo == value)
{
return;
}
userinfo = value;
RaisePropertyChanged("UserInfo");
}
public class User中的Set方法,但是为什么会通知界面进行更新呢?
{
public int Id { get; set; }
public string Name { get; set; }
public string Password { get; set; }
}
<TextBlock Grid.Column="0" Grid.Row="0" Text="用户名:"></TextBlock>
<TextBox Grid.Column="1" Grid.Row="0">
<TextBox.Text>
<Binding Path="UserInfo.Name" UpdateSourceTrigger="PropertyChanged" Mode="TwoWay">
<Binding.ValidationRules>
<!--<ExceptionValidationRule />-->
<local:UserValidate ValidateType="UserName" ></local:UserValidate>
</Binding.ValidationRules>