Export (0) Print
Expand All

BindingBase.TargetNullValue Property

Updated: July 2008

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

Namespace:  System.Windows.Data
Assembly:  PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation

public Object TargetNullValue { get; set; }
<object>
  <object.TargetNullValue>
    <Object .../>
  </object.TargetNullValue>
</object>

Property Value

Type: System.Object
The value that is used in the target when the value of the source is null.

The following example binds a TextBox to a property of an object. If the property is null, the TextBox displays "please enter a string."

<TextBox Width="150"
         Text="{Binding Source={StaticResource object2}, 
  Path=PropertyB, BindingGroupName=bindingGroup, 
  TargetNullValue=please enter a string}" />

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5 SP1, 3.0 SP2

Date

History

Reason

July 2008

Added topic for new member.

SP1 feature change.

Community Additions

ADD
Show:
© 2014 Microsoft