KvadrantAutoCompleteBox

fun KvadrantAutoCompleteBox(value: String, onValueChange: (String) -> Unit, suggestions: List<String>, onSuggestionSelect: (String) -> Unit, modifier: Modifier = Modifier, placeholder: String = "", enabled: Boolean = true, minimumPrefixLength: Int = MINIMUM_PREFIX_LENGTH, maximumSuggestions: Int = Int.MAX_VALUE, filter: (String, String) -> Boolean = ::startsWithIgnoringCase, cyrillic: FontFamily? = null)

A text box that offers what it thinks you are typing, from the Toolkit's AutoCompleteBox.

The library documented this control before it had it. KvadrantTypography.mediumLarge's KDoc names "a text box, a list picker and an autocomplete box" as the three controls Microsoft sized up from the page default — a sentence about a component that was not here, which is what B-43 was about.

The suggestion list is white in both themes, and that is transcribed rather than chosen. The template sets the ListBox inside its Popup to a literal Background="White" — not a theme brush, not PhoneBackgroundBrush — with BorderBrush="{StaticResource PhoneTextBoxEditBorderBrush}" around it. It is the same decision the focused field makes, where a dark theme's box goes solid white: what you are typing into is a sheet of paper whatever the page behind it is.

TranscribedValue
The list's fillliteral White
Its borderPhoneTextBoxEditBorderBrush, the same the focused field takes
Padding on the list0,8
Margin on a row8,7
The field's Padding6,0,6,4 — asymmetric, and deeper at the bottom than the top
FilterModeStartsWith, case-insensitive, from the property's own metadata
MinimumPrefixLength1 — nothing is offered until a character is typed

One deviation, and it is a layout one. The Toolkit puts the list in a Popup, so it floats over whatever follows the field. This draws it in the control's own layout, below the field, which pushes the rest of the form down instead. A Popup renders outside the layout it belongs to, where neither a screenshot of this component nor a page that wants to place it can reach it — and a component whose whole point is only visible in a window nothing here can photograph is a component nobody can check. A caller who wants the float back puts this in a Box above the rest.

Parameters

suggestions

everything that could be offered; filter decides what is. The Toolkit's ItemsSource is the same list, and it did its own filtering for the same reason: the caller knows what a match means and a control does not.

filter

defaults to the Toolkit's own StartsWith, ignoring case. It takes the typed text first and the candidate second.