Pregunta

I have an autoCompleteBox in my wpf window and I set ValidatesOnDataErrors binding property to True for selectedItem property of autoCompleteBox control. When I show my wpf window by clicking on a ribbon Button, Validation Area of autocompletbox does not render correctly.

like the picture below:

a correct Item Selected but autocomplete still showing the validation

but when I show window by clicking on a standard Wpf button it work correctly like the picture below:

everything are ok

for more info I create and attached a sample source code:

sample of my problem

can anyone help me ?

Thanks.

¿Fue útil?

Solución

You're seeing both the custom error UI defined in the AutoCompleteBox's control template and the standard error template in the adorner. You should disable the latter:

<Style TargetType="{x:Type sysctrls:AutoCompleteBox}">
    <Setter Property="Validation.ErrorTemplate" Value="{x:Null}" />
</Style>
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top