diff --git a/docs/user-interface/controls/editor.md b/docs/user-interface/controls/editor.md index 3e1bcd0789..2ef9b34d99 100644 --- a/docs/user-interface/controls/editor.md +++ b/docs/user-interface/controls/editor.md @@ -1,7 +1,7 @@ --- title: "Editor" description: "The .NET MAUI Editor allows you to enter and edit multiple lines of text." -ms.date: 03/03/2022 +ms.date: 10/13/2023 --- # Editor @@ -10,8 +10,9 @@ The .NET Multi-platform App UI (.NET MAUI) defines the following properties: +::: moniker range="=net-maui-7.0" + - `AutoSize`, of type `EditorAutoSizeOption`, defines whether the editor will change size to accommodate user input. By default, the editor doesn't auto size. -- `CharacterSpacing`, of type `double`, sets the spacing between characters in the entered text. - `CursorPosition`, of type `int`, defines the position of the cursor within the editor. - `FontAttributes`, of type `FontAttributes`, determines text style. - `FontAutoScalingEnabled`, of type `bool`, defines whether the text will reflect scaling preferences set in the operating system. The default value of this property is `true`. @@ -19,25 +20,62 @@ The .NET Multi-platform App UI (.NET MAUI) - `FontSize`, of type `double`, defines the font size. - `HorizontalTextAlignment`, of type `TextAlignment`, defines the horizontal alignment of the text. - `IsTextPredictionEnabled`, of type `bool`, controls whether text prediction and automatic text correction is enabled. -- `Placeholder`, of type `string`, defines the text that's displayed when the control is empty. -- `PlaceholderColor`, of type , defines the color of the placeholder text. - `SelectionLength`, of type `int`, represents the length of selected text within the editor. -- `Text`, of type `string`, defines the text entered into the editor. -- `TextColor`, of type , defines the color of the entered text. - `VerticalTextAlignment`, of type `TextAlignment`, defines the vertical alignment of the text. +::: moniker-end + +::: moniker range=">=net-maui-8.0" + +- `AutoSize`, of type `EditorAutoSizeOption`, defines whether the editor will change size to accommodate user input. By default, the editor doesn't auto size. +- `HorizontalTextAlignment`, of type `TextAlignment`, defines the horizontal alignment of the text. +- `VerticalTextAlignment`, of type `TextAlignment`, defines the vertical alignment of the text. + +::: moniker-end + These properties are backed by objects, which means that they can be targets of data bindings, and styled. In addition, defines a `Completed` event, which is raised when the user finalizes text in the with the return key. derives from the `InputView` class, from which it inherits the following properties: +::: moniker range="=net-maui-7.0" + +- `CharacterSpacing`, of type `double`, sets the spacing between characters in the entered text. +- `IsReadOnly`, of type `bool`, defines whether the user should be prevented from modifying text. The default value of this property is `false`. +- `IsSpellCheckEnabled`, of type `bool`, controls whether spell checking is enabled. +- `Keyboard`, of type `Keyboard`, specifies the virtual keyboard that's displayed when entering text. +- `MaxLength`, of type `int`, defines the maximum input length. +- `Placeholder`, of type `string`, defines the text that's displayed when the control is empty. +- `PlaceholderColor`, of type , defines the color of the placeholder text. +- `Text`, of type `string`, defines the text entered into the control. +- `TextColor`, of type , defines the color of the entered text. +- `TextTransform`, of type `TextTransform`, specifies the casing of the entered text. + +::: moniker-end + +::: moniker range=">=net-maui-8.0" + +- `CharacterSpacing`, of type `double`, sets the spacing between characters in the entered text. +- `CursorPosition`, of type `int`, defines the position of the cursor within the editor. +- `FontAttributes`, of type `FontAttributes`, determines text style. +- `FontAutoScalingEnabled`, of type `bool`, defines whether the text will reflect scaling preferences set in the operating system. The default value of this property is `true`. +- `FontFamily`, of type `string`, defines the font family. +- `FontSize`, of type `double`, defines the font size. - `IsReadOnly`, of type `bool`, defines whether the user should be prevented from modifying text. The default value of this property is `false`. - `IsSpellCheckEnabled`, of type `bool`, controls whether spell checking is enabled. +- `IsTextPredictionEnabled`, of type `bool`, controls whether text prediction and automatic text correction is enabled. - `Keyboard`, of type `Keyboard`, specifies the virtual keyboard that's displayed when entering text. - `MaxLength`, of type `int`, defines the maximum input length. +- `Placeholder`, of type `string`, defines the text that's displayed when the control is empty. +- `PlaceholderColor`, of type , defines the color of the placeholder text. +- `SelectionLength`, of type `int`, represents the length of selected text within the control. +- `Text`, of type `string`, defines the text entered into the control. +- `TextColor`, of type , defines the color of the entered text. - `TextTransform`, of type `TextTransform`, specifies the casing of the entered text. +::: moniker-end + These properties are backed by objects, which means that they can be targets of data bindings, and styled. In addition, `InputView` defines a `TextChanged` event, which is raised when the text in the changes. The `TextChangedEventArgs` object that accompanies the `TextChanged` event has `NewTextValue` and `OldTextValue` properties, which specify the new and old text, respectively. diff --git a/docs/user-interface/controls/entry.md b/docs/user-interface/controls/entry.md index 2d9d2c2e05..85681c527e 100644 --- a/docs/user-interface/controls/entry.md +++ b/docs/user-interface/controls/entry.md @@ -1,7 +1,7 @@ --- title: "Entry" description: "The .NET MAUI Entry allows you to enter and edit a single line of text." -ms.date: 03/03/2022 +ms.date: 10/13/2023 --- # Entry @@ -10,6 +10,8 @@ The .NET Multi-platform App UI (.NET MAUI) defines the following properties: +::: moniker range="=net-maui-7.0" + - `CharacterSpacing`, of type `double`, sets the spacing between characters in the entered text. - `ClearButtonVisibility`, of type `ClearButtonVisibility`, controls whether a clear button is displayed, which enables the user to clear the text. The default value of this property ensures that a clear button isn't displayed. - `CursorPosition`, of type `int`, defines the position of the cursor within the entry. @@ -17,31 +19,72 @@ The .NET Multi-platform App UI (.NET MAUI) - `FontAutoScalingEnabled`, of type `bool`, defines whether the text will reflect scaling preferences set in the operating system. The default value of this property is `true`. - `FontFamily`, of type `string`, defines the font family. - `FontSize`, of type `double`, defines the font size. -- `Keyboard`, of type `Keyboard`, specifies the virtual keyboard that's displayed when entering text. - `HorizontalTextAlignment`, of type `TextAlignment`, defines the horizontal alignment of the text. - `IsPassword`, of type `bool`, specifies whether the entry should visually obscure typed text. - `IsTextPredictionEnabled`, of type `bool`, controls whether text prediction and automatic text correction is enabled. -- `Placeholder`, of type `string`, defines the text that's displayed when the control is empty. -- `PlaceholderColor`, of type , defines the color of the placeholder text. - `ReturnCommand`, of type `ICommand`, defines the command to be executed when the return key is pressed. - `ReturnCommandParameter`, of type `object`, specifies the parameter for the `ReturnCommand`. - `ReturnType`, of type `ReturnType`, specifies the appearance of the return button. - `SelectionLength`, of type `int`, represents the length of selected text within the entry. -- `Text`, of type `string`, defines the text entered into the entry. -- `TextColor`, of type , defines the color of the entered text. - `VerticalTextAlignment`, of type `TextAlignment`, defines the vertical alignment of the text. +::: moniker-end + +::: moniker range=">=net-maui-8.0" + +- `ClearButtonVisibility`, of type `ClearButtonVisibility`, controls whether a clear button is displayed, which enables the user to clear the text. The default value of this property ensures that a clear button isn't displayed. +- `HorizontalTextAlignment`, of type `TextAlignment`, defines the horizontal alignment of the text. +- `IsPassword`, of type `bool`, specifies whether the entry should visually obscure typed text. +- `ReturnCommand`, of type `ICommand`, defines the command to be executed when the return key is pressed. +- `ReturnCommandParameter`, of type `object`, specifies the parameter for the `ReturnCommand`. +- `ReturnType`, of type `ReturnType`, specifies the appearance of the return button. +- `VerticalTextAlignment`, of type `TextAlignment`, defines the vertical alignment of the text. + +::: moniker-end + These properties are backed by objects, which means that they can be targets of data bindings, and styled. In addition, defines a `Completed` event, which is raised when the user finalizes text in the with the return key. derives from the `InputView` class, from which it inherits the following properties: +::: moniker range="=net-maui-7.0" + +- `CharacterSpacing`, of type `double`, sets the spacing between characters in the entered text. +- `IsReadOnly`, of type `bool`, defines whether the user should be prevented from modifying text. The default value of this property is `false`. +- `IsSpellCheckEnabled`, of type `bool`, controls whether spell checking is enabled. +- `Keyboard`, of type `Keyboard`, specifies the virtual keyboard that's displayed when entering text. +- `MaxLength`, of type `int`, defines the maximum input length. +- `Placeholder`, of type `string`, defines the text that's displayed when the control is empty. +- `PlaceholderColor`, of type , defines the color of the placeholder text. +- `Text`, of type `string`, defines the text entered into the control. +- `TextColor`, of type , defines the color of the entered text. +- `TextTransform`, of type `TextTransform`, specifies the casing of the entered text. + +::: moniker-end + +::: moniker range=">=net-maui-8.0" + +- `CharacterSpacing`, of type `double`, sets the spacing between characters in the entered text. +- `CursorPosition`, of type `int`, defines the position of the cursor within the editor. +- `FontAttributes`, of type `FontAttributes`, determines text style. +- `FontAutoScalingEnabled`, of type `bool`, defines whether the text will reflect scaling preferences set in the operating system. The default value of this property is `true`. +- `FontFamily`, of type `string`, defines the font family. +- `FontSize`, of type `double`, defines the font size. - `IsReadOnly`, of type `bool`, defines whether the user should be prevented from modifying text. The default value of this property is `false`. - `IsSpellCheckEnabled`, of type `bool`, controls whether spell checking is enabled. +- `IsTextPredictionEnabled`, of type `bool`, controls whether text prediction and automatic text correction is enabled. +- `Keyboard`, of type `Keyboard`, specifies the virtual keyboard that's displayed when entering text. - `MaxLength`, of type `int`, defines the maximum input length. +- `Placeholder`, of type `string`, defines the text that's displayed when the control is empty. +- `PlaceholderColor`, of type , defines the color of the placeholder text. +- `SelectionLength`, of type `int`, represents the length of selected text within the control. +- `Text`, of type `string`, defines the text entered into the control. +- `TextColor`, of type , defines the color of the entered text. - `TextTransform`, of type `TextTransform`, specifies the casing of the entered text. +::: moniker-end + These properties are backed by objects, which means that they can be targets of data bindings, and styled. In addition, `InputView` defines a `TextChanged` event, which is raised when the text in the changes. The `TextChangedEventArgs` object that accompanies the `TextChanged` event has `NewTextValue` and `OldTextValue` properties, which specify the new and old text, respectively. diff --git a/docs/user-interface/controls/searchbar.md b/docs/user-interface/controls/searchbar.md index 0c23fffb0b..42086b1d1b 100644 --- a/docs/user-interface/controls/searchbar.md +++ b/docs/user-interface/controls/searchbar.md @@ -1,7 +1,7 @@ --- title: "SearchBar" description: "The .NET MAUI SearchBar is a user input control that is used for initiating a search. The SearchBar control supports placeholder text, query input, execution, and cancellation." -ms.date: 02/15/2022 +ms.date: 10/13/2023 --- # SearchBar @@ -12,8 +12,9 @@ The .NET Multi-platform App UI (.NET MAUI) defines the following properties: +::: moniker range="=net-maui-7.0" + - `CancelButtonColor` is a that defines the color of the cancel button. -- `CharacterSpacing`, is a `double` that's the spacing between characters of the text. - `CursorPosition` is an `int` that determines the position at which the next character will be inserted into the string stored in the `Text` property. - `FontAttributes` is a `FontAttributes` enum value that determines whether the font is bold, italic, or neither. - `FontAutoScalingEnabled` is a `bool` which defines whether an app's UI reflects text scaling preferences set in the operating system. @@ -21,21 +22,69 @@ The .NET Multi-platform App UI (.NET MAUI) that defines the color of the placeholder text. - `SearchCommand` is an `ICommand` that allows binding user actions, such as finger taps or clicks, to commands defined on a viewmodel. - `SearchCommandParameter` is an `object` that specifies the parameter that should be passed to the `SearchCommand`. - `SelectionLength` is an `int` that can be used to return or set the length of text selection within the . -- `Text` is a `string` containing the query text in the . -- `TextColor` is a that defines the query text color. - `VerticalTextAlignment` is a `TextAlignment` enum value that defines the vertical alignment of the query text. +::: moniker-end + +::: moniker range=">=net-maui-8.0" + +- `CancelButtonColor` is a that defines the color of the cancel button. +- `HorizontalTextAlignment` is a `TextAlignment` enum value that defines the horizontal alignment of the query text. +- `SearchCommand` is an `ICommand` that allows binding user actions, such as finger taps or clicks, to commands defined on a viewmodel. +- `SearchCommandParameter` is an `object` that specifies the parameter that should be passed to the `SearchCommand`. +- `VerticalTextAlignment` is a `TextAlignment` enum value that defines the vertical alignment of the query text. + +::: moniker-end + These properties are backed by objects, which means that they can be targets of data bindings, and styled. In addition, defines a `SearchButtonPressed` event, which is raised when the search button is clicked, or the enter key is pressed. -> [!NOTE] -> derives from the `InputView` class, from which it inherits additional properties and events. + derives from the `InputView` class, from which it inherits the following properties: + +::: moniker range="=net-maui-7.0" + +- `CharacterSpacing`, of type `double`, sets the spacing between characters in the entered text. +- `IsReadOnly`, of type `bool`, defines whether the user should be prevented from modifying text. The default value of this property is `false`. +- `IsSpellCheckEnabled`, of type `bool`, controls whether spell checking is enabled. +- `Keyboard`, of type `Keyboard`, specifies the virtual keyboard that's displayed when entering text. +- `MaxLength`, of type `int`, defines the maximum input length. +- `Placeholder`, of type `string`, defines the text that's displayed when the control is empty. +- `PlaceholderColor`, of type , defines the color of the placeholder text. +- `Text`, of type `string`, defines the text entered into the control. +- `TextColor`, of type , defines the color of the entered text. +- `TextTransform`, of type `TextTransform`, specifies the casing of the entered text. + +::: moniker-end + +::: moniker range=">=net-maui-8.0" + +- `CharacterSpacing`, of type `double`, sets the spacing between characters in the entered text. +- `CursorPosition`, of type `int`, defines the position of the cursor within the editor. +- `FontAttributes`, of type `FontAttributes`, determines text style. +- `FontAutoScalingEnabled`, of type `bool`, defines whether the text will reflect scaling preferences set in the operating system. The default value of this property is `true`. +- `FontFamily`, of type `string`, defines the font family. +- `FontSize`, of type `double`, defines the font size. +- `IsReadOnly`, of type `bool`, defines whether the user should be prevented from modifying text. The default value of this property is `false`. +- `IsSpellCheckEnabled`, of type `bool`, controls whether spell checking is enabled. +- `IsTextPredictionEnabled`, of type `bool`, controls whether text prediction and automatic text correction is enabled. +- `Keyboard`, of type `Keyboard`, specifies the virtual keyboard that's displayed when entering text. +- `MaxLength`, of type `int`, defines the maximum input length. +- `Placeholder`, of type `string`, defines the text that's displayed when the control is empty. +- `PlaceholderColor`, of type , defines the color of the placeholder text. +- `SelectionLength`, of type `int`, represents the length of selected text within the control. +- `Text`, of type `string`, defines the text entered into the control. +- `TextColor`, of type , defines the color of the entered text. +- `TextTransform`, of type `TextTransform`, specifies the casing of the entered text. + +::: moniker-end + +These properties are backed by objects, which means that they can be targets of data bindings, and styled. + +In addition, `InputView` defines a `TextChanged` event, which is raised when the text in the changes. The `TextChangedEventArgs` object that accompanies the `TextChanged` event has `NewTextValue` and `OldTextValue` properties, which specify the new and old text, respectively. ## Create a SearchBar diff --git a/docs/whats-new/dotnet-8.md b/docs/whats-new/dotnet-8.md index 582f2305e5..7ca33d2952 100644 --- a/docs/whats-new/dotnet-8.md +++ b/docs/whats-new/dotnet-8.md @@ -29,6 +29,7 @@ For information about what's new in .NET 8, see [What's new in .NET 8](/dotnet/c - gains an `AddWithSpan` extension method that adds a view to the `Grid` at the specified row and column with the specified row and column spans. - On iOS, `MauiUIApplicationDelegate` gains a `PerformFetch` method that can be overridden or consumed via the `iOSLifecycle.PerformFetch` delegate. For more information, see [iOS platform lifecycle events](~/fundamentals/app-lifecycle.md#ios). - The class gains the ability to handle secondary taps on Android. For more information, see [Recognize a tap gesture](~/fundamentals/gestures/tap.md). +- Some of the common properties from the , , and controls have moved to the base class. For more information, see [Editor](~/user-interface/controls/editor.md), [Entry](~/user-interface/controls/entry.md), and [SearchBar](~/user-interface/controls/searchbar.md). The following types or members have been deprecated: