BindingCondition 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
此類別代表與任意繫結目標的值比較。
public ref class BindingCondition sealed : Microsoft::Maui::Controls::Condition, Microsoft::Maui::Controls::Xaml::IValueProvider
[Microsoft.Maui.Controls.Xaml.AcceptEmptyServiceProvider]
public sealed class BindingCondition : Microsoft.Maui.Controls.Condition, Microsoft.Maui.Controls.Xaml.IValueProvider
[<Microsoft.Maui.Controls.Xaml.AcceptEmptyServiceProvider>]
type BindingCondition = class
inherit Condition
interface IValueProvider
Public NotInheritable Class BindingCondition
Inherits Condition
Implements IValueProvider
- 繼承
- 屬性
- 實作
備註
類別 BindingCondition 可以比較目前範圍內任何類別上的系結值。 除了觸發程式清單中的任何系結條件之外,想要與包含周圍 MultiTrigger 條件之控制項上的系結屬性進行比較的開發人員,可能會想要使用 PropertyCondition 。
下列 XML 範例會在周圍 MultiTrigger (省略) 內建立系結條件,當所參考 name
的屬性 Text.Length
長度等於 0
時,會成功。 (name
必須參考具有 Text
屬性的 元素,例如 TextCell 具有 Length
屬性。)
<BindingCondition Binding="{Binding Source={x:Reference name},
Path=Text.Length}"
Value="0" />
建構函式
BindingCondition() |
初始化新的 BindingCondition 執行個體。 |
屬性
Binding |
取得或設定 Value 屬性與其進行比較的繫結。 |
Value |
符合條件的繫結值。 |
明確介面實作
IValueProvider.ProvideValue(IServiceProvider) |
此類別代表與任意繫結目標的值比較。 |