-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #874 from telerik/master
Merged from master
- Loading branch information
Showing
16 changed files
with
310 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-109 Bytes
(100%)
controls/collectionview/images/collectionview-getting-started.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+78 Bytes
(100%)
controls/datagrid/columns/images/datagrid-custom-cellrenderer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
--- | ||
title: Customizing Chat Item Styles in .NET MAUI | ||
description: Learn how to modify the appearance of chat items, including text color, in the Telerik UI for .NET MAUI Chat component. | ||
type: how-to | ||
page_title: How to Customize Chat Item Styles in Telerik UI for .NET MAUI | ||
slug: customize-chat-item-styles-dotnet-maui | ||
tags: chat, conversational ui, .net maui, styling, text color, item template selector, implicit style | ||
res_type: kb | ||
category: knowledge-base | ||
ticketid: 1652367 | ||
--- | ||
|
||
## Environment | ||
|
||
| Version | Product | Author | | ||
| --- | --- | ---- | | ||
| 7.0.0 | Telerik UI for .NET MAUI Conversational UI | [Dobrinka Yordanova](https://www.telerik.com/blogs/author/dobrinka-yordanova)| | ||
|
||
|
||
## Description | ||
|
||
This KB article answers the following questions: | ||
- How can I change the text color of chat items in .NET MAUI? | ||
- Is there a way to apply custom styles to chat items in .NET MAUI? | ||
- How to use item template selectors for styling chat messages? | ||
|
||
## Solution | ||
|
||
To customize the style of the chat items in the [Chat]({%slug chat-overview%}) control for .NET MAUI, choose one of the approaches described in this KB article. | ||
|
||
### Approach 1: Using Item Template Selector | ||
|
||
Refer to the [Item Template Selector]({%slug chat-itemtemplate-selector%}) documentation. You can change the text color by adding a style targeting the `Label` and setting its `TextColor` property. For example, use a style named `DefaultLabelStyle`. | ||
See the example code in the <a href="https://github.com/telerik/maui-samples/tree/main/Samples/SdkBrowser/Examples/ChatControl/FeaturesCategory" target="_blank">Telerik MAUI Controls Samples Chat Examples</a> | ||
|
||
### Approach 2: Using Implicit Style | ||
|
||
Use an implicit style targeting `TextMessageView` or its derived types like `IncomingTextMessageView` and `OutgoingTextMessageView`. | ||
|
||
```xml | ||
<Style x:Key="LabelStyle" TargetType="Label"> | ||
<Setter Property="TextColor" Value="Red" /> | ||
</Style> | ||
<Style TargetType="telerik:TextMessageView" ApplyToDerivedTypes="True"> | ||
<Setter Property="LabelStyle" Value="{StaticResource LabelStyle}" /> | ||
</Style> | ||
``` | ||
|
||
For further examples, refer to the <a href="https://github.com/telerik/maui-samples/blob/main/Samples/SdkBrowser/Examples/ChatControl/FeaturesCategory/CustomizationExample/Customization.xaml" target="_blank">Telerik MAUI Controls Samples Chat Customization example</a> | ||
|
||
## Notes | ||
|
||
- The `TextMessageView` and its derived types (`IncomingTextMessageView`, `OutgoingTextMessageView`) are crucial for applying text styles. | ||
- The `LabelStyle` is an example of how to directly modify the `TextColor` property, but you can customize other properties similarly. | ||
|
||
## See Also | ||
|
||
- [Chat Overview]({%slug chat-overview%}) | ||
- [Item Template Selector Documentation]({%slug chat-itemtemplate-selector%}) |
101 changes: 101 additions & 0 deletions
101
knowledge-base/customize-selection-indicator-color-navigationview.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
--- | ||
title: Customizing Selection Indicator Color in NavigationView for .NET MAUI on Windows | ||
description: Learn how to change the selection indicator color of NavigationViewItemView in .NET MAUI NavigationView on Windows. | ||
type: how-to | ||
page_title: How to Customize the Selection Indicator Color in .NET MAUI NavigationView on Windows | ||
slug: customize-selection-indicator-color-navigationview-net-maui | ||
tags: navigationview, .net maui, selection indicator, color, customization | ||
res_type: kb | ||
ticketid: 1656066 | ||
--- | ||
|
||
## Environment | ||
|
||
| Product | Version | | ||
| --- | --- | | ||
| Telerik UI for .NET MAUI NavigationView | 7.0.0 | | ||
|
||
## Description | ||
|
||
When using the [NavigationView](https://docs.telerik.com/devtools/maui/controls/navigationview/overview) in a .NET MAUI application, the selection indicator (a small vertical colored bar) appears in the accent color of the device by default. This article demonstrates how to customize the color of the selection indicator in the NavigationViewItemView. | ||
|
||
This KB article also answers the following questions: | ||
- How can I change the NavigationViewItemView indicator color in .NET MAUI? | ||
- What method allows for the customization of the selection indicator in NavigationView? | ||
- Is it possible to override the default accent color of the selection indicator in .NET MAUI NavigationView? | ||
|
||
## Solution | ||
|
||
To customize the selection indicator color in the `NavigationViewItemView`, override its `ControlTemplate` and modify the `BackgroundColor` of the last `RadBorder` element inside the `NavigationViewItemView_ControlTemplate_WinUI`. Apply an implicit style in your application to achieve this customization. | ||
|
||
Below is an example of how to define the implicit style: | ||
|
||
```xml | ||
<ResourceDictionary> | ||
<ControlTemplate x:Key="NavigationViewItemView_ControlTemplate"> | ||
<Grid BackgroundColor="Transparent"> | ||
<telerikMauiControls:RadBorder BackgroundColor="{TemplateBinding BackgroundColor}" | ||
Background="{TemplateBinding Background}" | ||
BorderColor="{TemplateBinding BorderColor}" | ||
BorderBrush="{TemplateBinding BorderBrush}" | ||
BorderThickness="{TemplateBinding BorderThickness}" | ||
CornerRadius="{TemplateBinding CornerRadius}" | ||
Margin="{TemplateBinding ContentPadding}" /> | ||
<Grid ColumnDefinitions="Auto, *" | ||
ColumnSpacing="{TemplateBinding Spacing}"> | ||
<Grid WidthRequest="{TemplateBinding LeadingWidth}"> | ||
<Image Source="{TemplateBinding ActualImageSource}" | ||
Aspect="{TemplateBinding ImageAspect}" | ||
WidthRequest="{TemplateBinding ImageWidth}" | ||
HeightRequest="{TemplateBinding ImageHeight}" /> | ||
</Grid> | ||
<ContentPresenter Grid.Column="1" /> | ||
</Grid> | ||
</Grid> | ||
</ControlTemplate> | ||
<ControlTemplate x:Key="NavigationViewItemView_ControlTemplate_WinUI"> | ||
<Grid BackgroundColor="Transparent"> | ||
<telerikMauiControls:RadBorder BackgroundColor="{TemplateBinding BackgroundColor}" | ||
Background="{TemplateBinding Background}" | ||
BorderColor="{TemplateBinding BorderColor}" | ||
BorderBrush="{TemplateBinding BorderBrush}" | ||
BorderThickness="{TemplateBinding BorderThickness}" | ||
CornerRadius="{TemplateBinding CornerRadius}" | ||
Margin="{TemplateBinding ContentPadding}" /> | ||
<Grid ColumnDefinitions="Auto, *" | ||
ColumnSpacing="{TemplateBinding Spacing}"> | ||
<Grid WidthRequest="{TemplateBinding LeadingWidth}"> | ||
<Image Source="{TemplateBinding ActualImageSource}" | ||
Aspect="{TemplateBinding ImageAspect}" | ||
WidthRequest="{TemplateBinding ImageWidth}" | ||
HeightRequest="{TemplateBinding ImageHeight}" /> | ||
</Grid> | ||
<ContentPresenter Grid.Column="1" /> | ||
</Grid> | ||
<telerikMauiControls:RadBorder IsVisible="{TemplateBinding IsSelected}" | ||
BackgroundColor="Pink" | ||
HorizontalOptions="Start" | ||
CornerRadius="2" | ||
WidthRequest="3" | ||
ScaleY="0.5" | ||
Margin="{TemplateBinding ContentPadding}" /> | ||
</Grid> | ||
</ControlTemplate> | ||
<Style TargetType="telerik:NavigationViewItemView"> | ||
<Setter Property="ControlTemplate" Value="{OnPlatform Default={StaticResource NavigationViewItemView_ControlTemplate}, | ||
WinUI={StaticResource NavigationViewItemView_ControlTemplate_WinUI}}" /> | ||
</Style> | ||
</ResourceDictionary> | ||
``` | ||
|
||
This style targets the `NavigationViewItemView` and sets the `ControlTemplate` property. Depending on the platform, it uses the appropriate resource (`NavigationViewItemView_ControlTemplate` for default and `NavigationViewItemView_ControlTemplate_WinUI` for Windows). | ||
|
||
## Notes | ||
|
||
- Remember to define the `ControlTemplate` resources (`NavigationViewItemView_ControlTemplate` and `NavigationViewItemView_ControlTemplate_WinUI`) in your application resources. These templates should include the customization for the selection indicator color. | ||
- The process might require creating a customized control template that replicates the original but with the desired changes to the selection indicator color. | ||
|
||
## See Also | ||
|
||
- [Telerik UI for .NET MAUI NavigationView Documentation](https://docs.telerik.com/devtools/maui/controls/navigationview/overview) | ||
- [Customizing .NET MAUI Control Templates](https://docs.microsoft.com/en-us/dotnet/maui/fundamentals/control-templates) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
--- | ||
title: Overriding MinWidth in NumericInput for MAUI | ||
description: Learn how to adjust the MinWidth of the NumericInput's InputEditor in MAUI to prevent content from being cut off. | ||
type: how-to | ||
page_title: How to Adjust the MinWidth of NumericInput's InputEditor in MAUI | ||
slug: numericinput-maui-overriding-minwidth | ||
tags: numericinput, maui, customization, minwidth, inputeditor | ||
res_type: kb | ||
ticketid: 1656724 | ||
--- | ||
|
||
## Environment | ||
|
||
| Product | Version | | ||
| --- | --- | | ||
| NumericInput for MAUI | 7.0.0 | | ||
|
||
## Description | ||
|
||
When styling the [NumericInput](https://docs.telerik.com/devtools/maui/controls/numericinput/overview) with `HorizontalTextAlignment` set to `End`, the value is cut off as the control's width decreases. This issue occurs because the `InputEditor` has a `MinWidth` of 64. | ||
|
||
This KB article also answers the following questions: | ||
- How can I prevent the NumericInput value from being cut off when aligned to the end? | ||
- Is it possible to customize the MinWidth of the NumericInput's InputEditor in MAUI? | ||
- How to adjust the NumericInput's styling to utilize unused space on the left? | ||
|
||
## Solution | ||
|
||
To address the issue of the NumericInput's value being cut off due to the `MinWidth` setting of the `InputEditor`, follow these steps: | ||
|
||
1. Define the ControlTemplate—To access RadNumericInput's internal NumericInputEntry subcomponent, follow the directions in the [NumericInput - ControlTemplate](https://docs.telerik.com/devtools/maui/controls/numericinput/control-template) documentation. | ||
|
||
2. Subscribe to the NumericInputEntry's Loaded Event: | ||
|
||
```xaml | ||
<telerik:NumericInputEntry x:Name="PART_Entry" | ||
Style="{TemplateBinding ActualEntryStyle}" | ||
Loaded="OnNumericInputLoaded"/> | ||
``` | ||
```csharp | ||
private void OnNumericInputLoaded(object sender, EventArgs e) | ||
{ | ||
} | ||
``` | ||
|
||
3. Access the native Entry element—To access platform-specific implementation, use conditional compilation `#ifdef` for WINDOWS, and define the `Handler.PlatformView` as the abstract `RadMauiEntry` type. | ||
|
||
```csharp | ||
private void OnNumericInputLoaded(object sender, EventArgs e) | ||
{ | ||
#if WINDOWS | ||
if ((sender as NumericInputEntry)?.Handler?.PlatformView is RadMauiEntry nativeEntry) | ||
{ | ||
} | ||
#endif | ||
} | ||
``` | ||
|
||
4. Set the Inputeditor's MinWdith property—With access to the handler's PlatformView, you can now set the `MinWidth` property of the concrete native WinUI `InputEditor` (which is of type RadTextBox). | ||
|
||
```csharp | ||
private void OnNumericInputLoaded(object sender, EventArgs e) | ||
{ | ||
#if WINDOWS | ||
if ((sender as NumericInputEntry)?.Handler?.PlatformView is RadMauiEntry nativeEntry) | ||
{ | ||
// Concrete instance of InputEditor is WinUI RadTextBox | ||
nativeEntry.InputEditor.MinWidth = 0; | ||
} | ||
#endif | ||
} | ||
``` | ||
|
||
## Notes | ||
|
||
- Customizing internal settings of controls should be done with an understanding of the potential impact on control behavior and layout. | ||
- Always test customization thoroughly to ensure it meets your application's requirements. | ||
|
||
## See Also | ||
|
||
- [NumericInput Overview](https://docs.telerik.com/devtools/maui/controls/numericinput/overview) | ||
- [Customizing Entry Cursor in MAUI](https://docs.telerik.com/devtools/maui/knowledge-base/entry-cursor-customization) |