Skip to content

Commit 442d402

Browse files
committed
update chat and add redirects
1 parent aaf7577 commit 442d402

File tree

9 files changed

+92
-13
lines changed

9 files changed

+92
-13
lines changed

controls/chat/commands.md

Lines changed: 54 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,77 @@ The Telerik UI for .NET MAUI Chat allows you to attach commands that will be exe
1313
## Commands Related to the Chat Input Area:
1414

1515
* `SendMessageCommand` (`ICommand`)—Defines the command that is executed when the send button is clicked or the `Enter` key is pressed.
16+
* `PickFileCommand` (`ICommand`)—Defines the command that opens the Microsoft.Maui.Storage.FilePicker for attaching files for upload.
17+
* `PickPhotoCommand` (`ICommand`)—Defines the command that opens the Microsoft.Maui.Media.MediaPicker for attaching photos for upload.
18+
* `TakePhotoCommand` (`ICommand`)—Defines the command that opens the camera for attaching a photo.
19+
20+
>tip You need to grand permissions to access the device camera and device external storage.
1621
1722
## Commands Related to Attachments
1823

19-
* `` ()—
24+
* `AttachFilesCommand` (`ICommand`)—Defines the command that is executed when the files the end-user picked need to be attached/uploaded.
25+
* `DownloadAttachmentsCommand` (`ICommand`)—Defines the command that is executed when the end user initiates download of attachments for a `Telerik.Maui.Controls.Chat.ChatAttachmentsMessage`. The command parameter of this command is of type `Telerik.Maui.Controls.Chat.ChatDownloadAttachmentsCommandContext.`
26+
* `ShareAttachmentsCommand` (`ICommand`)—Defines the command that triggers the share attachments operation.
27+
* `RemoveAttachedFileCommand` (`ICommand`)—Defines the command that should remove an attached file from the `Telerik.Maui.Controls.RadChat.AttachedFilesSource` collection in the view model.
2028

2129
## Example with SendMessageCommand
2230

2331
Here is an example on how to define a command in the ViewModel and bind the `SendMessageCommand` to it:
2432

25-
**1.** Add the command's `Execute` method.
33+
1. Add the command's `Execute` method.
2634

2735
<snippet id='chat-commands-executemethod' />
2836

29-
**2.** Define the `RadChat` component:
37+
2. Define the `RadChat` component:
3038

3139
<snippet id='chat-commands-xaml' />
3240

33-
**3.** Add the ViewModel:
41+
3. Add the ViewModel:
3442

3543
<snippet id='chat-commands-viewmodel' />
3644

45+
## Example with AttachFilesCommand
46+
47+
1. Define the `RadChat` component:
48+
49+
<snippet id='chat-attachments-xaml' />
50+
51+
2. Add the `ViewModel` with the `AttachFilesCommand` definition:
52+
53+
<snippet id='chat-with-attachments-view-model' />
54+
55+
3. Create a sample `MessageItem` model:
56+
57+
<snippet id='chat-message-item' />
58+
59+
4. Create `AttachmentsItem` class and define the attachments collection property:
60+
61+
<snippet id='chat-attachments-item' />
62+
63+
5. Define an `AttachmentData` class to hold the attachment information:
64+
65+
<snippet id='chat-attachment-data' />
66+
67+
6. Define the custom class for the attachments file data:
68+
69+
<snippet id='chat-attached-file-data' />
70+
71+
7. Define a converter to convert a data item to a chat attachment. In general here you need to create and set up the corresponding `Telerik.Maui.Controls.Chat.ChatAttachedFile` for the given business object:
72+
73+
<snippet id='chat-attached-file-converter' />
74+
75+
8. Define a custom converter that converts from chat specific objects to business objects, so that the `ViewModel` does not have to handle chat specific classes:
76+
77+
<snippet id='chat-attached-file-command-converter' />
78+
79+
9. The `ItemConverter` is need in MVVM scenario as custom items are used:
80+
81+
<snippet id='chat-attachment-item-converter' />
82+
83+
10. The demo uses a custom data file server for uploading, downloading and deleting attachments:
84+
85+
<snippet id='chat-data-server' />
86+
3787
## See Also
3888

3989
- [MVVM Support]({% slug chat-mvvm-support%})

controls/chat/events.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@ Here is a list of the available events:
1414

1515
* `SendMessage`&mdash;Raised when a message is sent from the chat by the current author (by clicking the send message button or pressing Enter).
1616
* `AttachFiles`&mdash;Raised when the end user picks files to attach.
17+
* The `sender` argument, which is of type `object`, but can be cast to the `RadChat` type.
18+
* A `ChatAttachFilesEventArgs` object which provides the list of files (`IList<IFileInfo> FilesToAttach`) to attach to the chat message.
19+
1720
* `RemoveAttachedFile`&mdash;Raised when the end user removes an attached file, via the `X` button of the `ChatInputAreaAttachedFileItemView`.
21+
* The `sender` argument, which is of type `object`, but can be cast to the `RadChat` type.
22+
* * A `ChatRemoveAttachedFileEventArgs` object which provides the index (`Index` of type `int`) of the item that should be removed from the `Telerik.Maui.Controls.RadChat.AttachedFilesSource` and `Telerik.Maui.Controls.RadChat.AttachedFiles`.
1823

1924
## See Also
2025

controls/chat/items/attachments.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ slug: chat-attachments
88

99
# Attachments
1010

11-
The Telerik MAUI Chat control provides options to attach images, files, and other media to messages. You can achieve this by adding `Attachment` instances to the `Attachments` collection of a `TextMessage` item.
11+
The Telerik MAUI Chat control provides options to attach images, files, and other media to messages.

controls/chat/localization.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,13 @@ In `RadChat`, you can localize the following string:
1717

1818
| Localization Key | Default Value |
1919
| -----------------| ------------- |
20-
| `Chat_EntryPlaceholder` | `Type a message...` |
20+
| `Chat_EntryPlaceholder` | `Type a message...` |
21+
| `Chat_MessageAttachmentAction_Download` | `Download` |
22+
| `Chat_MessageAttachmentAction_Share` | `Share` |
23+
| `Chat_MessageAttachmentsListView_DownloadAll` | `Download All` |
24+
| `Chat_InputArea_PickFile` | `Attach files` |
25+
| `Chat_InputArea_PickPhoto` | `Attach photos` |
26+
| `Chat_InputArea_TakePhoto` | `Take photo` |
2127

2228
The localization key refers to the watermark message that appears in the input field of the Chat.
2329

controls/chat/overview.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ The Telerik UI for .NET MAUI Chat is a UI component that enables the implementat
1515
## Key Features of the .NET MAUI Chat
1616

1717
* [A variety of chat items for great user experience]({%slug chat-items-overview %})&mdash;You can choose between simple text messages, various pickers, such as list view, calendar, date and time pickers, and cards.
18+
* [Attachments]({%slug chat-attachments%})&mdash;The Chat control allows attaching files to the messages. The supported file types are images, documents, audio and video files. Also you can take photos and attach them to the messages.
19+
* [SpeechToTextButton Integration]({%slug chat-buttons-styling%}#style-the-more-button)&mdash;The Chat control supports speech-to-text functionality, which allows users to dictate their messages instead of typing them.
1820
* [Typing indicator]({%slug chat-typing-indicator%})&mdash;Use the typing indicator to let the users that other Chat participants are currently typing.
1921
* [Template Selectors]({%slug chat-itemtemplate-selector%})&mdash;Apply different templates to each Chat items.
2022
* [Predefined List of Suggestions]({%slug chat-suggested-actions%})&mdash;This feature allows you to have a predefind list of suggestions. So the users of the Chat can choose between predefined items before sending a message.

controls/chat/styling/buttons.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This section describes how to style the send, more and speech to text buttons in
1313

1414
## Style the Send Button
1515

16-
You can customize the icon of the send button by setting the `SendMessageButtonImage` (`ImageSource`) property.
16+
To customize the icon of the send button, use the `SendMessageButtonImage` (`ImageSource`) property.
1717

1818
The example below shows how to customize the Send button in your Chat control.
1919

@@ -32,17 +32,25 @@ The example below shows how to customize the Send button in your Chat control.
3232

3333
## Style the More Button
3434

35-
Control the visibility of the more button by setting the `IsMoreButtonVisible` (`bool`) property to `true`. The default value is `false`.
35+
The More button provides additional options for the user, such as attaching files or accessing other functionalities.
36+
37+
You can configure and style the More button using the following properties:
38+
39+
* `IsMoreButtonVisible` (`bool`) property controls the visibility of the more button. The default value is `false`.
3640

3741
* `AutoGenerateMoreButtonActions `(`bool`)&mdash;Defines whether to automatically generate default actions for the 'More' button. The default value is `true`.
3842

39-
Style the MoreButton using the `MoreButtonStyle` (`Style` with target type `Telerik.Maui.Controls.Chat.ChatMoreButtonToolbarItemView`) property.
43+
* Define the actions that will appear when the More button is tapped by adding instances of `ChatMoreButtonAction` to the `MoreButtonActions` (`IList<ChatMoreButtonAction>`) collection.
44+
45+
* Style the More button using the `MoreButtonStyle` (`Style` with target type `Telerik.Maui.Controls.Chat.ChatMoreButtonToolbarItemView`) property.
4046

4147
## Style the SpeechToTextButton
4248

43-
You can control the SpeechToTextButton visibility by setting the `IsSpeechToTextButtonVisible` (`bool`) property. By default, the button is visible on Android, iOS and MacCatalyst and not visible on Windows.
49+
To configure the SpeechToTextButton, use the following properties:
50+
51+
* `IsSpeechToTextButtonVisible` (`bool`) property controls the visibility of the SpeechToTextButton. By default, the button is visible on Android, iOS and MacCatalyst and not visible on Windows.
4452

45-
To style the SpeechToTextButton, use the `SpeechToTextButtonStyle` (`Style` with target type `Telerik.Maui.Controls.RadSpeechToTextButton`) property.
53+
* `SpeechToTextButtonStyle` (`Style` with target type `Telerik.Maui.Controls.RadSpeechToTextButton`) property is used to style the SpeechToTextButton.
4654

4755
## See Also
4856

controls/chat/styling/entry.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ The example below shows how to customize the chat entry in your Chat control. Th
3737

3838
## Customize the Send Button
3939

40-
You can customize the icon of the send button by setting the `SendMessageButtonImage` (`ImageSource`) property.
40+
The Telerik UI for .NET MAUI Chat allows you to customize the icon of the send button by setting the `SendMessageButtonImage` (`ImageSource`) property.
4141

4242
The example below shows how to customize the Send button in your Chat control.
4343

controls/chat/styling/messages.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ To customize the different parts of the control, you can use the following built
2828
In addition, the following properties set the background of the Chat:
2929

3030
* `BackgroundColor`(`Color`)&mdash;Defines the background color of the Chat control.
31-
* `InputAreaBackgroundColor`(`Color`)&mdash;Defines the bacgkround color of the area that the input elements (entry and button) reside.
31+
* `InputAreaBackgroundColor`(`Color`)&mdash;Defines the background color of the area that the input elements (entry and button) reside.
3232

3333
## See Also
3434

docs-builder.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,14 @@ redirects:
484484
to: /controls/busyindicator/content
485485
type: Permanent
486486

487+
- from: ^/controls/chat/styling$
488+
to: /controls/chat/styling/entry
489+
type: Permanent
490+
491+
- from: ^/controls/chat/item-template-selector$
492+
to: /controls/chat/templates/item-template-selector
493+
type: Permanent
494+
487495
- from: ^/controls/maskedentry/maskedentry-masked-types$
488496
to: /controls/maskedentry/mask-types/overview
489497
type: Permanent

0 commit comments

Comments
 (0)