Binding.IsBinding 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得值,指出繫結是否在作用中。
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
備註
當系結符合下列條件時,系結會處於作用中狀態:
其所有屬性都會設定。
使用者未呼叫 ResumeBinding 或 SuspendBinding BindingManagerBase 所屬的 Binding 。
已建立 所屬的 Binding 控制項。