Apr 26 Keith | Dev, C#, WPF

WPF Toolkit AutoCompleteBox Style Bug

I was re-templating the AutoCompleteBox control from the Feb 2010 WPF toolkit tonight (using in Blend 4 RC). It didn’t go so well. The values in the dropdown wouldn’t show.

image

I tracked it down to this annoying Border Opacity within the template part for the popup:

...
<Popup x:Name="Popup">
    <Grid Background="{TemplateBinding Background}" Opacity="{TemplateBinding Opacity}">
    <Border x:Name="PopupBorder" BorderThickness="0" Background="#11000000" HorizontalAlignment="Stretch" Opacity="0">
...

The bit to note is the hardcoded Opacity=”0”. Remove that and its fine:

image

Just one of those simple but annoying bugs that gets in the way of a seemly simple task. I reported it on the WPF Toolkit forums.

Oh yeah, and don’t drag the window when the dropdown is open LOL:

image

(note the AutoCompleteBox control is in the preview band, so we cant complain too much!)

About the author

Keith Woods

Keith Woods works for Lab49, a consulting firm that builds advanced solutions for the financial services industry.