MahApps / MahApps.Metro

A framework that allows developers to cobble together a better UI for their own WPF applications with minimal effort.
https://mahapps.com
MIT License
9.32k stars 2.45k forks source link

Request: new Control - AutoCompleteBox #2625

Open AndrzejKl opened 8 years ago

AndrzejKl commented 8 years ago

I think, it will be nice to have here AutoCompleteBox like in WPF Toolkit (with SelectedItem, Delay, FilterMode) and all others features, combining with watermark, FloatingWatermark, etc, to keep same style everywhere... What do you think, it's possible?

Evangelink commented 8 years ago

Should we go for something close to the AutoCompleteBox of WPF Toolkit or close to the UWP AutoSuggestBox?

AndrzejKl commented 8 years ago

@Evangelink Thanks for the reply. In my opinion we need use best things from both of them:

ghost commented 7 years ago

Is it necessary to make a new control or can we add this functionality through attached properties? After all, an AutoCompleteBox/AutoSuggestBox is just a glorified TextBox.

feO2x commented 6 years ago

I would like to add some thoughts on this topic as I find it not to be trivial: I think there should be two controls instead of just one, serving different scenarios:

  1. In the first case the context is to select a single item from a collection of items (e.g. some sort of ID). The user can start to type and a popup shows up narrowing down the items shown based on some search / filter algorithm. The input is not complete as long as the user has selected one of the items either via clicking on an item in the popup (keyboard support should be there, too) or by typing the exact same string of one of the items. I would call this control AutoCompleteBox and its basically a ComboBox in non-edit mode (and thus it should also derive from Selector and use its given properties). I've already tried to adopt the existing WPF Combo Box for this purpose but I couldn't get it to work (can't override the popup logic).
  2. The second case is to type free text (e.g. an email address). When the user starts to type the popup shows up suggesting existing email addresses, but the user is not bound to choose one of those. I would call this AutoSuggestBox and it basically derives from TextBox or TextBoxBase (or maybe we could also solve this issue with a new TextBox template and some attached properties).

Anyway, here are some issues that we have in both cases:

I would like to contribute these controls to the project - what's your opinion on these thoughts?

AndrzejKl commented 6 years ago

In my case I use it only as an pop up - it means that it suggest but without obligation to select it (like textbox, but with validation - is empty or not). Filtering combinations are important. I use it also for an objects (DisplayMemberPath) together with validation (item is an object or not). So what I missing in wpfToolkit AutoCompleteBox is MahApps features (watermarks, etc.). That's why I was asking about control - to look the same with other MahApps controls.