Binding.IsBinding 属性

定义

获取指示绑定是否活动的值。

public:
 property bool IsBinding { bool get(); };
public bool IsBinding { get; }
member this.IsBinding : bool
Public ReadOnly Property IsBinding As Boolean

属性值

如果绑定处于活动状态,为 true;否则为 false

示例

下面的代码示例打印PropertyName窗体上每个Binding的 和 IsBinding 值。

private:
   void PrintBindingIsBinding()
   {
      for each ( Control^ c in this->Controls )
      {
         for each ( Binding^ b in c->DataBindings )
         {
            Console::WriteLine( "\n {0}", c );
            Console::WriteLine( "{0} IsBinding: {1}",
               b->PropertyName, b->IsBinding );
         }
      }
   }
private void PrintBindingIsBinding()
{
   foreach(Control c in this.Controls)
   {
      foreach(Binding b in c.DataBindings)
      {
         Console.WriteLine("\n" + c.ToString());
         Console.WriteLine(b.PropertyName + " IsBinding: " 
             + b.IsBinding);
      }
   }
}
Private Sub PrintBindingIsBinding
    Dim c As Control
    Dim b As Binding
    For Each c In Me.Controls
        For Each b in c.DataBindings
            Console.WriteLine (ControlChars.CrLf & c.ToString)
            Console.WriteLine (b.PropertyName & " IsBinding: " & _
                b.IsBinding)
        Next
    Next
End Sub

注解

绑定满足以下条件时处于活动状态:

适用于