R – Silverlight 3 ValidatesOnException not found

silverlightvalidation

I'm trying to add the validation and get the following from the compiler.

The property 'ValidatesOnException' was not found in type 'Binding'.
The property 'ValidatesOnException' does not exist on the type 'Binding' in the XML namespace 'http://schemas.microsoft.com/winfx/2006/xaml/presentation'.

I tried adding System.Windows.Data in System.Windows as a xmlns but no luck.

The following are my attempts at the markup.

<TextBox x:Name="Office" Style="{StaticResource PhoneNumber}">
  <TextBox.Text>
    <Binding Path="Office" Mode="TwoWay" NotifyOnValidationError="true" ValidatesOnException="true" Converter="{StaticResource PhoneNumberConverter}" />
  </TextBox.Text>
</TextBox>


<TextBox x:Name="Office" Style="{StaticResource PhoneNumber}" Text="{Binding Office, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnException=true, Converter={StaticResource PhoneNumberConverter}}" />

Any ideas?

Best Answer

The property is not called ValidatesOnException it is called ValidatesOnExceptions note the plural.

Related Topic