Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AutoCompleteBox not found in wpf toolkit using visual studio 2012

Tags:

wpf

wpftoolkit

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.

like image 232
Anders Lindén Avatar asked Aug 20 '12 06:08

Anders Lindén


2 Answers

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 />
like image 135
nemesv Avatar answered Oct 07 '22 23:10

nemesv


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 />
like image 37
Hossein Amini Avatar answered Oct 08 '22 00:10

Hossein Amini