Freigeben über


ValidationSummary.Target Property

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Gets or sets the UIElement for which validation errors will be displayed in the summary.

Namespace:  System.Windows.Controls
Assembly:  System.Windows.Controls.Data.Input (in System.Windows.Controls.Data.Input.dll)

Syntax

'Declaration
Public Property Target As UIElement
public UIElement Target { get; set; }
<sdk:ValidationSummary Target="{Binding ElementName=targetElement}"/>

XAML Values

  • targetElement
    The Name or x:Name of a UIElement that the ValidationSummary is associated with. This syntax assumes that the working data context contains the named element. For more information, see ElementName.

Property Value

Type: System.Windows.UIElement
The UIElement for which validation errors will be displayed in the summary. The default is nulla null reference (Nothing in Visual Basic).

Remarks

Dependency property identifier field: TargetProperty

By default, the Target is nulla null reference (Nothing in Visual Basic) and the ValidationSummary displays errors for its parent container. To specify a different container for which the ValidationSummary will display errors, set the Target property. The Target is typically a container that holds other input controls, but can be a reference to any UIElement. You can set the Target in code or in XAML. To set it in XAML, you must use an ElementName binding.

Version Information

Silverlight

Supported in: 5, 4, 3

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.