This other SO question asks about autocomplete text field in WPF. Several people have created them, and one of the answers given there offers this article about code design.
But I did not find a single WPF autocomplete text field that can be compared with the WinForms autocomplete text field. Sample project code works, sort of ...

...but
- it is not structured as a reusable control or DLL. This is the code I need to embed in every application.
- Only works with directories. it has no properties to set whether the autocomplete source is only file system directories, or file system files, or .... etc. Of course, I could write code for this, but ... I would prefer to use another code already written.
- it has no properties for setting the size of the popup, etc.
- there is a popup with a list of possible completions. When navigating through this list, the text field does not change. Entering a character that is in focus in the list does not update the text field.
- moving the focus from the list does not lead to the disappearance of the pop-up list. This confuses.
So my question is:
* Does anyone have a FREE WPF autocomplete text box that works and provides a quality user interface? *
ANSWER
Here is how I did it:
+0.0. get WPF toolkit
0.1. run MSI for WPF Toolkit
0.2. In Visual Studio, drag from the toolbar, in particular from the Data Visualization group, into the user interface designer. It looks like this in the VS toolbox:

If you do not want to use a designer, make xaml manually. It looks like this:
<toolkit:AutoCompleteBox ToolTip="Enter the path of an assembly." x:Name="tbAssembly" Height="27" Width="102" Populating="tbAssembly_Populating" />
... where the toolbox namespace is displayed as follows:
xmlns:toolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit"
0.3. Specify the code for the Populating event. Here is what I used:
private void tbAssembly_Populating(object sender, System.Windows.Controls.PopulatingEventArgs e) { string text = tbAssembly.Text; string dirname = Path.GetDirectoryName(text); if (Directory.Exists(Path.GetDirectoryName(dirname))) { string[] files = Directory.GetFiles(dirname, "*.*", SearchOption.TopDirectoryOnly); string[] dirs = Directory.GetDirectories(dirname, "*.*", SearchOption.TopDirectoryOnly); var candidates = new List<string>(); Array.ForEach(new String[][] { files, dirs }, (x) => Array.ForEach(x, (y) => { if (y.StartsWith(dirname, StringComparison.CurrentCultureIgnoreCase)) candidates.Add(y); })); tbAssembly.ItemsSource = candidates; tbAssembly.PopulateComplete(); } }
It works the way you expect. He feels professional. There are no anomalies that the codeproject control exhibits. Here's what it looks like:

Thanks to Matt for pointing to the WPF toolkit.