WPF Get Multibinding Expression, Update Source,

wpf 拿到某个control的multibinding以及其中每个Binding

1. 拿到multibinding
      MultiBindingExpression  mbe = BindingOperations . GetMultiBindingExpression (( child as TextBox ), TextBox . TextProperty );

2. 拿到其中每个Binding的Path
        Binding bd = mbe . ParentMultiBinding . Bindings [0] as Binding ;
                bindingPath = bd . Path . Path ;

3. 拿到其中的ValidationRule
      ValidationRule  vr = mbe . ParentMultiBinding . ValidationRules [0];

4. 更新MultiBinding
        mbe . UpdateSource ();
   

你可能感兴趣的:(WPF)