0

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.

Eli Arbel
  • 22,391
  • 3
  • 45
  • 71
Ali Jalali
  • 145
  • 1
  • 3
  • 10
  • Did you figure out why are there differences in rendering the Window between clicking on a normal Button vs Ribbon button? – Vladimir Jul 05 '18 at 11:43

1 Answers1

2

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>
Eli Arbel
  • 22,391
  • 3
  • 45
  • 71