Maui Chat Control update style of chat items

2 Answers 49 Views
Chat (Conversational UI)
Euan
Top achievements
Rank 1
Euan asked on 17 May 2024, 02:19 PM

Hi,

Is there a way to update the styling of chat items, for example text colour? I have looked at the Styling documentation for the Chat control but I cannot see an example.

Thanks,

Euan

2 Answers, 1 is accepted

Sort by
0
Accepted
Elena
Telerik team
answered on 20 May 2024, 12:27 PM

Hello Euan,

This is an update to my previous answer.

There is another way to set the TextColor property without creating custom ItemTemplateSelector. It can be achieved by using an implicit style targeting TextMessageView or IncomingTextMessageView, OutgoingTextMessageView respectively.

            <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>

You can also refer to these examples - https://github.com/telerik/maui-samples/blob/main/Samples/SdkBrowser/Examples/ChatControl/FeaturesCategory/CustomizationExample/Customization.xaml.

I hope you find this information useful.

Regards,
Elena
Progress Telerik

A brand new ThemeBuilder course was just added to the Virtual Classroom. The training course was designed to help you get started with ThemeBuilder for styling Telerik and Kendo UI components for your applications. You can check it out at https://learn.telerik.com
0
Elena
Telerik team
answered on 20 May 2024, 08:27 AM

Hello Euan,

Thank you for providing the screenshot.

To style the chat items, please refer to the following page of the documentation - https://docs.telerik.com/devtools/maui/controls/chat/item-template-selector. Text color in particular can be changed by adding a style with target type Label and setting its TextColor property. In the example the style is named DefaultLabelStyle. The example code can be found here: https://github.com/telerik/maui-samples/tree/main/Samples/SdkBrowser/Examples/ChatControl/FeaturesCategory 

I hope you find this answer helpful. If you need further assistance, please reach out.

Regards,
Elena
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Chat (Conversational UI)
Asked by
Euan
Top achievements
Rank 1
Answers by
Elena
Telerik team
Share this question
or