Επεξεργασία

Κοινή χρήση μέσω


BindingBase.FallbackValue Property

Definition

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

public:
 property System::Object ^ FallbackValue { System::Object ^ get(); void set(System::Object ^ value); };
public object FallbackValue { get; set; }
member this.FallbackValue : obj with get, set
Public Property FallbackValue As Object

Property Value

The default value is UnsetValue.

Remarks

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 binding target (target) property.

If 1 and 2 return DependencyProperty.UnsetValue, the target property is set to the value of the FallbackValue, if one is available. If there is no FallbackValue, the default value of the target property is used.

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

XAML Text Usage

<object FallbackValue="fallbackValue" />  

- or -

<object>  
  <object.FallbackValue>  
    fallbackValue  
    </object.FallbackValue>  
</object>  

XAML Values

fallbackValue
An attribute or object element value of the same type as the target property. See that type's documentation for XAML usage information. That type may or may not support attribute syntax for its values, or may or may not support object element syntax (which requires a parameterless constructor on that type). The target property type will therefore influence which syntax you use for the value of the FallbackValue property.

Applies to

See also