.NET Framework Class Library
BindingBase..::.TargetNullValue Property

Updated: July 2008

Gets or sets the value that is used in the target when the value of the source is nullNothingnullptra null reference (Nothing in Visual Basic).

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
Syntax

Visual Basic (Declaration)
Public Property TargetNullValue As Object
Visual Basic (Usage)
Dim instance As BindingBase
Dim value As Object

value = instance.TargetNullValue

instance.TargetNullValue = value
C#
public Object TargetNullValue { get; set; }
Visual C++
public:
property Object^ TargetNullValue {
    Object^ get ();
    void set (Object^ value);
}
JScript
public function get TargetNullValue () : Object
public function set TargetNullValue (value : Object)
XAML Property Element Usage
<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 nullNothingnullptra null reference (Nothing in Visual Basic).
Examples

The following example binds a TextBox to a property of an object. If the property is nullNothingnullptra null reference (Nothing in Visual Basic), the TextBox displays "please enter a string."

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

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.
Version Information

.NET Framework

Supported in: 3.5 SP1, 3.0 SP2
See Also

Reference

Change History

Date

History

Reason

July 2008

Added topic for new member.

SP1 feature change.

Tags :


Page view tracker