ValidationError.ErrorContent Property


Gets or sets an object that provides additional context for this ValidationError, such as a string describing the error.

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

Property Value

An object that provides additional context for this ValidationError.


The following example shows a style trigger that creates a ToolTip that reports a validation error message. The Validation.Errors attached property returns a collection of ValidationError objects on the bound element.

<Style x:Key="textStyleTextBox" TargetType="TextBox">
  <Setter Property="Foreground" Value="#333333" />
  <Setter Property="MaxLength" Value="40" />
  <Setter Property="Width" Value="392" />
    <Trigger Property="Validation.HasError" Value="true">
      <Setter Property="ToolTip"
        Value="{Binding RelativeSource={RelativeSource Self},


XAML Text Usage

See the Example section for an example.

Applies to