KVADRANT UI api reference demo

KvadrantTextBox

controls

type in it: a light field in both themes, and focus does not bring in the accent

dark
light

mounted as text-box

why it looks like this

A Metro text box, from PhoneTextBox in the SDK's own System.Windows.xaml.

It is a light box in both themes, and this drew a transparent one. Background and BorderBrush are both PhoneTextBoxBrush — 75 % white on a dark page, 15 % black on a light one — and Foreground is PhoneTextBoxForegroundBrush, dark on that fill either way. What this had was a transparent field with the page's own text colour in it, which reads as a Material outlined field and is the single most recognisable thing about a Windows Phone form got wrong.

Focus does not bring in the accent. PhoneTextBoxEditBorderBrush is white on dark and 87 % black on light — the page's foreground — and PhoneTextBoxEditBackgroundBrush goes to solid white on dark and to transparent on light. So focusing brightens a dark theme's box and empties a light theme's, which is the light theme not being an inversion again.

Geometry is the template's: the border sits inside PhoneTouchTargetOverhang, so twelve pixels of invisible field surround it exactly as they surround a button, and the content carries Padding="2" plus PhoneTextBoxInnerMargin of 1,2. contentPadding is a parameter only because PhonePasswordBox differs from this in one number — its inner margin is 3,2.

actionIcon is the Toolkit's half of this control, and it was missing for as long as the library had the plain half (B-43). The Toolkit's PhoneTextBox puts an ActionIconBorder of Width="84" Height="72" at the bottom right of the field, transparent, holding a 26 × 26 image — so the icon is small and its target is not, which is the same relationship the app bar's glyphs have to their rings. Twenty-six is also the app bar's own icon size, which is corroboration rather than coincidence.

The icon is a slot rather than a drawable because D10 says so: no Segoe asset enters this repository, and a caller's glyph is the only kind there is.

Read it: kvadrant-core/src/commonMain/kotlin/io/github/youndie/kvadrant/components/Controls.kt · the full signature and every parameter