0

What should I use in WPF instead WinForms ErrorProvider control to show error messages?

I have looked at codeplex and at http://gallery.expression.microsoft.com/, and I didn't see anything similar.

Can anyone suggest a good WPF replacement to me?

UPDATE:

Let's take the standard approach that is applied in the codeproject article on WPF validation:

<TextBox>
    <TextBox.Text>
        <Binding Path="Name">
            <Binding.ValidationRules>
                <ExceptionValidationRule />
            </Binding.ValidationRules>
        </Binding>
    </TextBox.Text>
</TextBox>

This complies with .net 3 rules. In .net 4, Expression Blend Generates code like this:

<TextBox Margin="48,72,63,201" TextWrapping="Wrap" Text="{Binding Input, ElementName=Window, FallbackValue=1+1, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" TextChanged="TextBox_TextChanged" />

and trying to add Binding.ValidationRules inside this TextBox crashes the code.

What is the proper syntax of adding validation in .net 4?

Arsen Zahray
  • 24,367
  • 48
  • 131
  • 224

1 Answers1

0

you can do it by yourself. look here to see what i have done.

enter image description here

Community
  • 1
  • 1
blindmeis
  • 22,175
  • 7
  • 55
  • 74