PriorityBinding PriorityBinding PriorityBinding PriorityBinding Class

Definition

Describes a collection of Binding objects that is attached to a single binding target property, which receives its value from the first binding in the collection that produces a value successfully.

public ref class PriorityBinding : System::Windows::Data::BindingBase, System::Windows::Markup::IAddChild
[System.Windows.Markup.ContentProperty("Bindings")]
public class PriorityBinding : System.Windows.Data.BindingBase, System.Windows.Markup.IAddChild
type PriorityBinding = class
    inherit BindingBase
    interface IAddChild
Public Class PriorityBinding
Inherits BindingBase
Implements IAddChild
Inheritance
Attributes
Implements

Remarks

PriorityBinding lets you associate a binding target (target) property with a list of bindings. The first binding that returns a value successfully becomes the active binding.

A binding returns a value successfully if:

  1. The path to the binding source resolves successfully.

  2. The value converter, if any, is able to convert the resulting value.

  3. The resulting value is valid for the target property.

The value DependencyProperty.UnsetValue is not considered a successful return value.

The priority of the bindings is determined by their order in the list. The binding that appears first in the list has the highest priority.

The binding engine starts with the first binding in the list and verifies whether that binding returns a value successfully; if it does, the value from that binding is used. If the first binding does not return a value successfully, the binding engine examines the second binding to determine whether it returns a value successfully; if it does, the value from the second binding becomes the active value. This verification process continues to the end of the list of bindings. If none of the bindings returns a value successfully, the binding uses the FallbackValue.

The binding engine continues to listen for changes on all bindings. If at any point one of the bindings that has a higher priority returns a value successfully, the value for that binding becomes the active value and replaces the current value.

Constructors

PriorityBinding() PriorityBinding() PriorityBinding() PriorityBinding()

Initializes a new instance of the PriorityBinding class.

Properties

BindingGroupName BindingGroupName BindingGroupName BindingGroupName

Gets or sets the name of the BindingGroup to which this binding belongs.

(Inherited from BindingBase)
Bindings Bindings Bindings Bindings

Gets the collection of Binding objects that is established for this instance of PriorityBinding.

Delay Delay Delay Delay

Gets or sets the amount of time, in milliseconds, to wait before updating the binding source after the value on the target changes.

(Inherited from BindingBase)
FallbackValue FallbackValue FallbackValue FallbackValue

Gets or sets the value to use when the binding is unable to return a value.

(Inherited from BindingBase)
StringFormat StringFormat StringFormat StringFormat

Gets or sets a string that specifies how to format the binding if it displays the bound value as a string.

(Inherited from BindingBase)
TargetNullValue TargetNullValue TargetNullValue TargetNullValue

Gets or sets the value that is used in the target when the value of the source is null.

(Inherited from BindingBase)

Methods

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ProvideValue(IServiceProvider) ProvideValue(IServiceProvider) ProvideValue(IServiceProvider) ProvideValue(IServiceProvider)

Returns an object that should be set on the property where this binding and extension are applied.

(Inherited from BindingBase)
ShouldSerializeBindings() ShouldSerializeBindings() ShouldSerializeBindings() ShouldSerializeBindings()

Returns a value that indicates whether serialization processes should serialize the effective value of the Bindings property on instances of this class.

ShouldSerializeFallbackValue() ShouldSerializeFallbackValue() ShouldSerializeFallbackValue() ShouldSerializeFallbackValue()

Returns a value that indicates whether serialization processes should serialize the effective value of the FallbackValue property on instances of this class.

(Inherited from BindingBase)
ShouldSerializeTargetNullValue() ShouldSerializeTargetNullValue() ShouldSerializeTargetNullValue() ShouldSerializeTargetNullValue()

Returns a value that indicates whether the TargetNullValue property should be serialized.

(Inherited from BindingBase)
ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)

Explicit Interface Implementations

IAddChild.AddChild(Object) IAddChild.AddChild(Object) IAddChild.AddChild(Object) IAddChild.AddChild(Object)

This member supports the Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code.

IAddChild.AddText(String) IAddChild.AddText(String) IAddChild.AddText(String) IAddChild.AddText(String)

This member supports the Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code.

Applies to

See also