BindingCondition Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Class that represents a value comparison with the target of an arbitrary binding.
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
- Inheritance
- Attributes
- Implements
Remarks
The BindingCondition class can compare a value a binding on any class within the current scope. Developers who want to compare to a value to a bound property on the control that contains the conditions surrounding MultiTrigger may want to use a PropertyCondition in addition to any binding conditions in the trigger list.
The XML example below creates a binding condition within a surrounding MultiTrigger (omitted) that succeeds when the referenced name
has a Text.Length
property length that is equal to 0
. (name
must refer to an element, such as a TextCell, that has a Text
property that, in turn, has a Length
property.)
<BindingCondition Binding="{Binding Source={x:Reference name},
Path=Text.Length}"
Value="0" />
Constructors
BindingCondition() |
Initializes a new BindingCondition instance. |
Properties
Binding |
Gets or sets the binding against which the Value property will be compared. |
Value |
The binding value that satisfies the condition. |
Explicit Interface Implementations
IValueProvider.ProvideValue(IServiceProvider) |
Applies to
See also
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈