Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add vertical and horizontal scrollbars in collectionview docs. #982

Open
wants to merge 4 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions controls/collectionview/scrolling.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,16 @@ This is the result on WinUI:

> For a runnable demo with the CollectionView Programmatic Scrolling example, see the [SDKBrowser Demo Application]({%slug sdkbrowser-app%}) and go to the **CollectionView > Scrolling** category.

## ScrollBars

The CollectionView exposes an option to set the visibility of the vertical and the horizontal scrollbars by using the `VerticalScrollBarVisibility` (`enum` of type `Microsoft.Maui.ScrollBarVisibility`) and `HorizontalScrollBarVisibility` (`enum` of type `Microsoft.Maui.ScrollBarVisibility`) properties.
The available options for the `ScrollBarVisibility` enumeration are:
* `Default`—The visibility of the scrollbar will be the default for the platform based on the content and orientation.
* `Always`—The scollbar will be visible, regardless of the content or orientation.
* `Never`—The scrollbar will not be visible, regardless of the content or orientation.

Review the the [Ensuring CollectionView Scrollbar is Always Visible on Android in a .NET MAUI application]({%slug collectionview-scrollbar-visible-android%}) article for more details how to display the vertical scrollbar on Android.

## Events

The CollectionView exposes a `Scrolled` event that is invoked when scrolling is performed.
Expand Down
2 changes: 1 addition & 1 deletion controls/entry/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ slug: entry-commands
When using Telerik UI for .NET MAUI Entry control, you can use the following commands:


* `ReturnCommand`(`ICommand`)—Execute when the return key of the keyboard is pressed.
* `ReturnCommand` (`ICommand`)—Execute when the return key of the keyboard is pressed.

The `ReturnCommand` has a command parameter—`ReturnCommandParameter` which can be used to pass a parameter to the command execute method.

Expand Down
7 changes: 6 additions & 1 deletion controls/entry/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ The Entry supports the following events:
* `NewTextValue(string)`—Gets the new text value.
* `OldTextValue(string)`—Gets the old text value.

* `TextChanging`—Occurs when the text in the entry starts to change, but before the `Text` property is updated. The `TextChanging` event handler receives a `TextChangingEventArgs` argument containing data related to this event. The `TextChangedEventArgs` provides the following properties:
* `NewText` (`string`)`—Gets the new text that is about to be entered into the entry.
* `OldText` (`string`)`—Gets the old text that is entered into the entry.
* `Cancel` (`bool`)`—Gets or sets a value that indicates whether to cancel the text changes.

* `Completed`—Occurs when the user finalizes the text in an entry with the return key.

The following example demonstrates the Entry definition in XAML with the `TextChanged` and `Completed` event handlers.
Expand Down Expand Up @@ -56,4 +61,4 @@ private void Entry_Completed(object sender, EventArgs e)
## See Also

- [Entry Getting Started]({% slug entry-getting-started%})
- [Entry Styling]({% slug entry-styling%})
- [Entry Styling]({% slug entry-styling%})
27 changes: 18 additions & 9 deletions controls/entry/styling.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,34 @@ The Entry provides styling options for setting the appearance of its border and

Style the entry using the following properties:

* `CornerRadius`(`Microsoft.Maui.CornerRadius`)
* `BackgroundColor`(`Microsoft.Maui.Graphics`)
* `CornerRadius` (`Microsoft.Maui.CornerRadius`)
* `BackgroundColor` (`Microsoft.Maui.Graphics.Color`)
* `TextColor` (`Microsoft.Maui.Graphics.Color`)
* `PlaceholderColor` (`Microsoft.Maui.Graphics.Color`)
* `BorderBrush` (`Microsoft.Maui.Controls.Brush`)
* `BorderThickness` (`Microsoft.Maui.Thickness`)

You can apply visual States to the Entry control. For more details review [Entry Visual States]({%slug entry-visual-states%}) article.

>tip For a runnable example demonstrating the Entry Styling options, see the [SDKBrowser Demo Application]({%slug sdkbrowser-app%}) and go to the **Entry > Styling** category.

## Clear Button Style

Style the Clear button which is displayed by default when entering text in the control using the following properties:

* `ClearButtonColor`(`Microsoft.Maui.Graphics`)—Defines the color of the Clear button.
* `HoveredClearButtonColor`(`Microsoft.Maui.Graphics`)—Defines the color of the Clear button when the button is hovered. The color appears only on desktop(Windows and macOS).
* `PressedClearButtonColor`(`Microsoft.Maui.Graphics`)—Defines the color of the Clear button when the button is clicked.
* `ClearButtonVisibility` (`enum` of type `Microsoft.Maui.ClearButtonVisibility`)—Defines a value indicating whether the clear-button (the button that clears the text when pressed) will be visible. The options are: `Never` and `WhileEditing` (default).
* `ClearButtonStyle` (`Style` with target type `RadTemplatedButton`)—Specifies the style of the clear button. Review the [TemplatedButton Visual States]({%slug templatedbutton-visual-states%}) article for more details on the available visual states.

>tip For a runnable example demonstrating the Entry Styling options, see the [SDKBrowser Demo Application]({%slug sdkbrowser-app%}) and go to the **Entry > Styling** category.

## Font Options

The Entry control has the following properties for defining the font options:

* `FontAttributes`
* `FontFamily`
* `FontSize`
* `FontAutoScalingEnabled`
* `FontAttributes` (`enum` of type `Microsoft.Maui.Controls.FontAttributes`)
* `FontFamily` (`string`)
* `FontSize` (`double`)
* `FontAutoScalingEnabled` (`bool`)

The following example demonstrates how to apply the font options to the Entry.

Expand Down
20 changes: 10 additions & 10 deletions controls/entry/text-appearance.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ The Entry provides a number of settings for configuring the appearance of the te

The following properties are related to the Entry Text appearance and alignment:

* `Text`(`string`)—Defines the text.
* `TextColor`(`Microsoft.Maui.Graphics`)—Defines the color of the visible Entry text.
* `TextTransform`(`Microsoft.Maui.TextTransform`)—Defines the transformation of the text.
* `Text` (`string`)—Defines the text.
* `TextColor` (`Microsoft.Maui.Graphics`)—Defines the color of the visible Entry text.
* `TextTransform` (`Microsoft.Maui.TextTransform`)—Defines the transformation of the text.
* `VerticalTextAlignment` (`Microsoft.Maui.TextAlignment`)—Specifies the vertical alignment of the text.
* `HorizontalTextAlignment` (`Microsoft.Maui.TextAlignment`)—Specifies the horizontal alignment of the text.

## Adding Placeholder

The Entry exposes the `Placeholder`(`string`) property that prompts users what information they are expected to enter in the text input. The placeholder text is displayed when the control is empty. Additionally, you can set the `PlaceholderColor`(`Color`) to customize the look of the watermark text as demonstrated in the following example.
The Entry exposes the `Placeholder` (`string`) property that prompts users what information they are expected to enter in the text input. The placeholder text is displayed when the control is empty. Additionally, you can set the `PlaceholderColor`(`Color`) to customize the look of the watermark text as demonstrated in the following example.

```XAML
<telerikInput:RadEntry Placeholder="First Name"
Expand All @@ -42,7 +42,7 @@ The following image shows the end result.

## Password functionality

The Telerik .NET MAUI Entry provides `IsPassword`(`bool`) property, which when set to `True`, replaces the input with password hint character. The default value is `False`.
The Telerik .NET MAUI Entry provides `IsPassword` (`bool`) property, which when set to `True`, replaces the input with password hint character. The default value is `False`.

```XAML
<telerik:RadEntry Placeholder="Enter password"
Expand All @@ -52,7 +52,7 @@ The Telerik .NET MAUI Entry provides `IsPassword`(`bool`) property, which when s

## Setting the Read-Only State

You can choose whether the Entry control is editable for end users or not by setting its read-only state through the `IsReadOnly` `bool` property. By default, `IsReadOnly` is set to `False`. To restrict the control from editing, set the `IsReadOnly` to `True`.
You can choose whether the Entry control is editable for end users or not by setting its read-only state through the `IsReadOnly` (`bool`) property. By default, `IsReadOnly` is set to `False`. To restrict the control from editing, set the `IsReadOnly` to `True`.

```XAML
<telerik:RadEntry x:Name="telerikEntry"
Expand All @@ -74,11 +74,11 @@ The following example demonstrates how to set the maximum length of the input to

## Setting spacing between the characters

The `CharacterSpacing`(`double`)property allows you to define the space between the characters inside the control.
The `CharacterSpacing` (`double`)property allows you to define the space between the characters inside the control.

## Setting Text Prediction

* `IsTextPredictionEnabled`(`bool`)property allows you to define whether text prediction and automatic text correction is on or off. The default value is false.
* `IsTextPredictionEnabled` (`bool`)property allows you to define whether text prediction and automatic text correction is on or off. The default value is false.

```XAML
<telerik:RadEntry x:Name="entry"
Expand All @@ -93,7 +93,7 @@ The `Keyboard` property of type `Microsoft.Maui.Keyboard` allows you to define t
```XAML
<telerik:RadEntry x:Name="entry"
Keyboard="Numeric"
Placeholder="Enter Text" />
Placeholder="Enter Number" />
```

## Setting the Return Type
Expand All @@ -108,7 +108,7 @@ You can change the keyboard **return key type** using the `ReturnType`(`Microsof

## Defining the Clear Button visibility

The `ClearButtonVisibility`(`Microsoft.Maui.ClearButtonVisibility`) indicates when the clear-button (the button that clears the text when pressed) can be displayed. The default value is `WhileEditing`.
The `ClearButtonVisibility` (`Microsoft.Maui.ClearButtonVisibility`) indicates when the clear-button (the button that clears the text when pressed) can be displayed. The default value is `WhileEditing`.
If you want to hide the clear button while entering text inside the control, then set the `ClearButtonVisibility` to `Never`.

## See Also
Expand Down
10 changes: 5 additions & 5 deletions controls/entry/text-selection.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ The Entry supports a number of settings for managing the selection of its input

The text selection properties provided by the Entry are:

* `CursorPosition`(`int`)&mdash;Specifies the starting position of the selected text in the entry.
* `CursorPosition` (`int`)&mdash;Specifies the starting position of the selected text in the entry.

* `SelectionLength`(`int`)&mdash;Specifies the number of characters in the current Entry selection.
* `SelectionLength` (`int`)&mdash;Specifies the number of characters in the current Entry selection.

* `SelectionOnFocus`(`Telerik.Maui.SelectionOnFocus`)&mdash;Specifies the text selection behavior when the Entry control receives focus. The available options are:
* `Unchanged`&mdash;the selection will not be modified.
* `SelectionOnFocus` (`Telerik.Maui.SelectionOnFocus`)&mdash;Specifies the text selection behavior when the Entry control receives focus. The available options are:
* (Default) `Unchanged`&mdash;the selection will not be modified.
* `CursorAtStart`&mdash;the cursor will be moved at the start of the text.
* `CursorAtEnd`&mdash;the cursor will be moved at the end of the text.
* `SelectAll`&mdash;the whole text will be selected.
Expand All @@ -34,4 +34,4 @@ The following snippet shows how to use the `SelectionOnFocus` property to presel
## See Also

- [Events]({% slug entry-events%})
- [Styling]({% slug entry-styling%})
- [Styling]({% slug entry-styling%})
8 changes: 8 additions & 0 deletions controls/entry/validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ The image below shows the error icon that is displayed inside the reserved space

![Entry validation](images/entry_ReserveSpaceForErrorView_property.png)

## Styling the Error View

Use the following properties to style the error view when validation applies:

* `ValidationErrorColor` (`Color`)&mdash;Defines the custom color for the error views.
* `ValidationErrorImageStyle` (`Style` with target type `Image`)&mdash;Defines the style that applies to the error icon.
* `ValidationErrorLabelStyle` (`Style` with target type `Label`)&mdash;Defines the style that applies to the error label.

## See Also

- [Text Appearance]({% slug entry-text-appearance%})
Expand Down
68 changes: 68 additions & 0 deletions controls/entry/visual-states.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
title: Visual States
page_title: .NET MAUI Entry Documentation - Visual States
description: Learn how to set the border color, background color and other in the different visual states of the Telerik Entry for .NET MAUI.
position: 9
tags: .net maui, telerik .net maui, ui for .net maui, entry, states, microsoft .net maui
slug: entry-visual-states
---

# .NET MAUI Entry Visual States

The Entry provides the following `CommonStates` visual states:

| Visual State | Description |
| ------------- | --------------- |
| `Normal` | Applies when the entry is in normal state. |
| `Focused` | Applies when the entry is focused. |
| `MouseOver` | (Desktop-only) Applies when the mouse pointer is over the entry. |
| `Invalid` | Applies when there is a validation and the text entered inside the entry is not valid (the `IsValueValid` property is set to `false`). |
| `InvalidFocused` | Applies when the entry is focused and there is a validation and the text entered inside the entry is not valid (the `IsValueValid` property is set to `false`). |
| `InvalidMouseOver` | (Desktop-only) Applies when the mouse is over the entry and there is a validation and the text entered inside the entry is not valid (the `IsValueValid` property is set to `false`). |
| `ReadOnly` | Applies when the entry is not editable (the `IsReadOnly` property is set to `false`). |
| `ReadOnlyFocused` | Applies when the entry is focused and not editable (the `IsReadOnly` property is set to `false`). |
| `ReadOnlyMouseOver` | (Desktop-only) Applies when the mouse pointer is over the entry, and the entry is not editable (the `IsReadOnly` property is set to `false`) |
| `ReadOnlyInvalid` | Applies when the entry is not editable (the `IsReadOnly` property is set to `false`) and not valid (the `IsValueValid` property is set to `false`). |
| `ReadOnlyInvalidFocused` | Applies when the entry is focused, not editable (the `IsReadOnly` property is set to `false`) and not valid (the `IsValueValid` property is set to `false`). |
| `ReadOnlyInvalidMouseOver` | (Desktop-only) Applies when the mouse pointer is over the entry, and the entry is not editable (the `IsReadOnly` property is set to `false`) and not valid (the `IsValueValid` property is set to `false`). |
| `Disabled` | Applies when the entry is disabled. |

### Using the Visual States

The following example demonstrates how to use the Entry Visual States.

**1.** Define the Entry in XAML:

<snippet id='entry-style' />

**2.** Define the entry style in the page's resources:

<snippet id='entry-styling' />

**2.** Define the clear button style in the page's resources:

<snippet id='entry-styling-clear-button' />

**2.** Define the validation error label style in the page's resources:

<snippet id='entry-styling-validation-error-label' />

**2.** Define the validation error image style in the page's resources:

<snippet id='entry-styling-validation-error-image' />

**3.** Add the `telerik` namespace:

```XAML
xmlns:telerik="http://schemas.telerik.com/2022/xaml/maui"
```

This is the result on WinUI:

![.NET MAUI Entry Visual States](images/)

>tip For a runnable example demonstrating the Entry visual state, see the [SDKBrowser Demo Application]({%slug sdkbrowser-app%}) and go to the **Entry > Styling** category.

## See Also

- [Entry Styling]({%slug entry-styling%})
8 changes: 7 additions & 1 deletion controls/templatedbutton/styling.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,15 @@ To style the TemplatedButton, you can use the following properties:
* `TextColor` (`Color`)&mdash;Specifies the color of the `Label.Text` created when `Content` is `string` and `ContentTemplate` is not set.
* All Properties from the [Content Configuration]({%slug templatedbutton-configuration%}) article can be applied through style.

The TemplatedButton uses the .NET MAUI Visual State Manager and it defines a visual state group named `CommonStates` with the following visual states:
* `Normal`
* `PointerOver`
* `Pressed`
* `Disabled`

### Using the Styling API

The following example demonstrates how to apply implicit and explicit styles to the TemplatedButton.
The following example demonstrates how to apply implicit and explicit styles to the TemplatedButton using the visual states.

**1.** Define the buttons in XAML:

Expand Down