Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

An attached behavior for WPF's TextBox control that provides auto-completion suggestions from a given collection

License

Notifications You must be signed in to change notification settings

CodeFork/WPFTextBoxAutoComplete

Open more actions menu
 
 

Repository files navigation

WPFTextBoxAutoComplete

An attached behavior for WPF's TextBox control that provides auto-completion suggestions from a given collection

How to use this library:

  1. Install the package via NuGet

    	PM> Install-Package WPFTextBoxAutoComplete
    
  2. Add a reference to the library in your view

    	xmlns:behaviors="clr-namespace:WPFTextBoxAutoComplete;assembly=WPFTextBoxAutoComplete"
  3. Create a textbox and bind the "AutoCompleteItemsSource" to a collection of IEnumerable<String>

    	<TextBox 
    		Width="250"
    		HorizontalAlignment="Center"
    		Text="{Binding TestText, UpdateSourceTrigger=PropertyChanged}" 
    		behaviors:AutoCompleteBehavior.AutoCompleteItemsSource="{Binding TestItems}" 
    	/>
  4. (Optional) Set the "AutoCompleteStringComparison" property, which is of type StringComparison

    	<TextBox 
    		Width="250"
    		HorizontalAlignment="Center"
    		Text="{Binding TestText, UpdateSourceTrigger=PropertyChanged}" 
    		behaviors:AutoCompleteBehavior.AutoCompleteItemsSource="{Binding TestItems}" 
    		behaviors:AutoCompleteBehavior.AutoCompleteStringComparison="InvariantCultureIgnoreCase"
    	/>

Now, every time the "TestText" property of your datacontext is changed, WPFTextBoxAutoComplete will provide you with auto-completion suggestions. To accept a suggestion, just hit "enter".

About

An attached behavior for WPF's TextBox control that provides auto-completion suggestions from a given collection

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%
Morty Proxy This is a proxified and sanitized view of the page, visit original site.