10

This is really a wanted feature, AutoCompleteBox (not AutoCompleteComboBox apparently). However, visual studio 2012 cannot find the AutoCompleteBox control. But I have not tried in earlier version of vs, so it may not be a version matter.

I installed wpf toolkit, added those extensions to my WPF project:

  • WPF Toolkit
  • WPF Toolkit Design
  • WPF Toolkit Input Design
  • WPF Toolkit Input Visual Studio Design
  • WPF Toolkit Layout
  • WPF Toolkit Layout Visual Studio Design
  • WPF Toolkit Visual Studio Design.

Looks almost like virii to me. Every permutation of words are used... Well well in my WPF project, I added

xmlns:toolkit="http://schemas.microsoft.com/wpf/2008/toolkit"

to a window and tried to also add a auto complete box like this:

<toolkit:AutoCompleteBox />

but AutoCompleteBox does not seem to exist, the first component that is listed when I have typed

<toolkit:

is ButtonBaseBehavior.

Anders Lindén
  • 6,839
  • 11
  • 56
  • 109
  • The following references need for the toolkit: `WPFToolkit.dll, System.Windows.Controls.Input.Toolkit.dll, System.Windows.Controls.Layout.Toolkit.dll`. So you need to reference the `System.Windows.Controls.Input.Toolkit` dll for the AutoComplateBox – nemesv Aug 20 '12 at 07:08
  • Thanks for the answer! ButtonBaseBehavior is still the first listed class that I can use so there is something I have not done to make it work. – Anders Lindén Aug 20 '12 at 07:18

2 Answers2

24

Not all the toolkit controls are included in the "main" namepace.

Let me explain it how are the toolkit dlls are built up:

You can also install the WPF toolkit through NuGet:

PM> Install-Package WPFToolkit

It will add three dlls to your project:

  • WPFToolkit.dll this contains the core/stable controls of toolkit which can be found in the xmlns:toolkit="http://schemas.microsoft.com/wpf/2008/toolkit"

  • System.Windows.Controls.Input.Toolkit.dll this dll contains the preview controls like AutoCompleteBox and Rating

  • System.Windows.Controls.Layout.Toolkit.dll this dll contains the preview layout controls like the Accordion

The preview controlls are not included in the main xmls namespace so you need to use a the namespace form the corresponding preview dll:

xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit"

<controls:AutoCompleteBox />
nemesv
  • 138,284
  • 16
  • 416
  • 359
  • I get `Install-Package : Unable to find package 'WPFToolkit'` error – Prihex Nov 10 '20 at 14:37
  • The package has been renamed to Extended.Wpf.Toolkit https://www.nuget.org/packages/Extended.Wpf.Toolkit/ – nemesv Nov 10 '20 at 15:47
  • Actually, I've found https://www.nuget.org/packages/WPFToolkit/3.5.50211.1 and it says *"Please use the XCeed version of the toolkit: Extended.Wpf.Toolkit."* as you. However, I didn't find AutoCompleteBox control in https://github.com/xceedsoftware/wpftoolkit. This link has given in the description. – Prihex Nov 11 '20 at 14:02
2

Add a reference to (Included in WPFToolkit): System.Windows.Controls.Input.Toolkit.dll and then in your xaml at the top:

xmlns:System_Windows_Controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit"

and for using it anywhere in your code just like this:

<System_Windows_Controls:AutoCompleteBox />
Hossein Amini
  • 716
  • 9
  • 21