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:
but when I show window by clicking on a standard Wpf button it work correctly like the picture below:
for more info I create and attached a sample source code:
can anyone help me ?
Thanks.
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>