Text input markup reference
이 콘텐츠는 아직 번역되지 않았습니다.
Single-line, multi-line, and password text boxes.
TextBase
Section titled “TextBase”Receiver: TextBase and derived types (where T : TextBase).
| Method | Sets | Summary |
|---|---|---|
AcceptTab(bool value = true) |
AcceptTab |
Sets whether Tab inserts a tab character instead of moving focus. |
CaretPosition(int value) |
CaretPosition |
Sets the caret position as a character index into the document. |
ImeMode(ImeMode value) |
ImeMode |
Sets the IME mode for this text control. |
IsReadOnly(bool value = true) |
IsReadOnly |
Sets whether the text is read-only. |
MaxLength(int value) |
MaxLength |
Sets the maximum text length in UTF-16 code units. 0 means unlimited. |
OnTextChanged(Action<string> handler) |
event TextChanged |
Subscribes handler to TextChanged. Occurs when the text changes. |
OnTextCompositionEnd(Action<TextCompositionEventArgs> handler) |
event TextCompositionEnd |
Subscribes handler to TextCompositionEnd. Occurs when an IME composition ends. |
OnTextCompositionStart(Action<TextCompositionEventArgs> handler) |
event TextCompositionStart |
Subscribes handler to TextCompositionStart. Occurs when an IME composition starts. |
OnTextCompositionUpdate(Action<TextCompositionEventArgs> handler) |
event TextCompositionUpdate |
Subscribes handler to TextCompositionUpdate. Occurs when the IME composition text changes. |
OnTextInput(Action<TextInputEventArgs> handler) |
event TextInput |
Subscribes handler to TextInput. Occurs when the control receives text input. |
Placeholder(string value) |
Placeholder |
Sets the placeholder text shown while the document is empty. |
SelectionBackground(Color value) |
SelectionBackground |
Sets the color painted behind the selected text; the default style dims it while the control does not have focus. |
SelectionForeground(Color? value) |
SelectionForeground |
Sets the color the selected glyphs are painted in; null keeps their own colors, so a colorized document stays readable through a selection. |
MultiLineTextBox
Section titled “MultiLineTextBox”Receiver: MultiLineTextBox.
| Method | Sets | Summary |
|---|---|---|
BindText(ObservableValue<TSource> source, Func<TSource, string> convert, Func<string, TSource> convertBack = null) |
bind Text |
Binds the text to a converted observable value. |
BindText(ObservableValue<string> source) |
bind Text |
Binds the text to an observable value. |
OnEditingStateChanged(Action handler) |
event EditingStateChanged |
Subscribes handler to EditingStateChanged. Occurs when the caret, the selection or the undo state changes. |
OnTextCommitted(Action<string> handler) |
event TextCommitted |
Subscribes handler to TextCommitted. Raised after typed or composed text reached the document, once per commit. |
OnWrapChanged(Action<bool> handler) |
event WrapChanged |
Subscribes handler to WrapChanged. Occurs when Wrap changes. |
SizeToDocument(bool value = true) |
SizeToDocument |
Sets whether the desired size is the document’s extent clamped to the offered space, instead of the offered space itself; the default is false. |
TabSize(int value) |
TabSize |
Sets the tab width in space characters. |
Text(string value) |
Text |
Sets the text content. |
VerticalScrollBarVisibility(ScrollBarVisibility value) |
VerticalScrollBarVisibility |
Sets when the vertical scrollbar is shown; the text scrolls either way. |
Wrap(bool value = true) |
Wrap |
Sets whether lines wrap at the viewport width. |
PasswordBox
Section titled “PasswordBox”Receiver: PasswordBox.
| Method | Sets | Summary |
|---|---|---|
BindPassword(ObservableValue<TSource> source, Func<TSource, string> convert, Func<string, TSource> convertBack = null) |
bind Password |
Binds the password to a converted observable value. |
BindPassword(ObservableValue<string> source) |
bind Password |
Binds the password to an observable value. |
OnPasswordChanged(Action handler) |
event PasswordChanged |
Subscribes handler to PasswordChanged. Occurs when the password text changes; it carries no value, so read Password directly if needed. |
Password(string value) |
Password |
Sets the password text. |
PasswordChar(char value) |
PasswordChar |
Sets the character used to mask the password. |
TextBox
Section titled “TextBox”Receiver: TextBox.
| Method | Sets | Summary |
|---|---|---|
BindText(ObservableValue<TSource> source, Func<TSource, string> convert, Func<string, TSource> convertBack = null) |
bind Text |
Binds the text to a converted observable value. |
BindText(ObservableValue<string> source) |
bind Text |
Binds the text to an observable value. |
Text(string value) |
Text |
Sets the text content. |