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();
   
posted @ 2013-07-02 11:43  muzizongheng  阅读(352)  评论(0编辑  收藏  举报
如果我们时时忙着展现自己的知识, 将何从忆起成长所需的无知?