Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

BindingBase.FallbackValue Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

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

Namespace:   System.Windows.Data
Assembly:  PresentationFramework (in PresentationFramework.dll)

public object FallbackValue { get; set; }

Property Value

Type: System.Object

The default value is DependencyProperty.UnsetValue.

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.

<objectFallbackValue="fallbackValue" />

- or –

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

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 default constructor on that type). The target property type will therefore influence which syntax you use for the value of the FallbackValue property.

.NET Framework
Available since 3.0
Silverlight
Available since 4.0
Windows Phone Silverlight
Available since 7.1
Return to top
Show:
© 2017 Microsoft