public sealed class KeyValueRowOne key and what it is worth, as a row of a KeyValueList.
Remarks
⚠ The value half is an element, not a string, and that is the whole reason this is a control rather than two divs. A settings panel puts a TextBox, a Switch or a Slider where a debugger puts a number, and a row that only took text would be rewritten by hand the first time somebody needed to edit one. ValuePart is where either goes, and ContentHost points at it so that <KeyValueRow Key="Volume"><Slider /></KeyValueRow> in a .vxml lands the slider in the right half without the markup naming a part.
⚠ Value and a child element are exclusive, and the framework rather than this control is what says so. UiElement.OnTextChanged attaches a measure function to an element with text, and the layout algorithm treats a node that measures itself as a leaf — it does not lay out its children at all. So a slot holding both would draw the string and silently place the editor nowhere. Setting Value therefore empties the slot first, and Content``1 clears the text; both directions are safe, which is what a pooled row switching between the two needs.
No third column. Every hand-rolled version of this in the editor that has one uses it for a different thing — a byte count's unit, a budget bar, a diagnostic's stage — and a generic third slot is a slot with no meaning that every caller has to decide about. Two halves is the shape that is the same everywhere; anything else belongs in the value half as an element of its own.
Fields and properties (11)
protected override string TagNameThe element name this type answers to when a caller does not choose one.
protected override bool AcceptsFocusWhether the focus can rest on this kind of control at all.
public string? Keypublic string? Valuepublic bool IsHeadingpublic UiElement KeyPartThe left half's element.
public UiElement ValuePartThe right half's element: where a value's text goes, and where an editor goes.
protected override UiElement ContentHostWhere content written inside this element's tag actually goes.
public static readonly UiPropertyKey KeyPropertyIdentity for Key.
public static readonly UiPropertyKey ValuePropertyIdentity for Value.
public static readonly UiPropertyKey IsHeadingPropertyIdentity for IsHeading.
Methods (6)
public T Content<T>() where T : UiElement, new()Puts a control in the value half, in place of whatever was there.
public void Reset()Puts the row back to a blank key and a blank value, for a pool that is reusing it.
protected override void OnCreated()Builds whatever this element is made of, once, as it joins a document.
public void ClearKey()Unsets Key, so it takes its default or its ancestor's value again.
public void ClearValue()Unsets Value, so it takes its default or its ancestor's value again.
public void ClearIsHeading()Unsets IsHeading, so it takes its default or its ancestor's value again.
Used by (11)
- AccessibilityTreeTestsVixen.Ui.Controls.Tests
- DiagnosticsPanelVixen.Ui.Controls
- DiagnosticsPanelTestsVixen.Ui.Controls.Tests
- FactSheetVixen.Ui.Controls.Tests
- KeyValueListVixen.Ui.Controls
- KeyValueListTestsVixen.Ui.Controls.Tests
- CompositorSettingsTestsVixen.Editor.AssetEditors.Tests
- CompositorViewVixen.Editor.AssetEditors
- FrameDebuggerViewVixen.Editor.Debugger
- NetworkViewVixen.Editor.Debugger
- UiDiagnosticsPanelTestsVixen.Editor.App.Tests