You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: controls/chat/commands.md
+54-4Lines changed: 54 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,27 +13,77 @@ The Telerik UI for .NET MAUI Chat allows you to attach commands that will be exe
13
13
## Commands Related to the Chat Input Area:
14
14
15
15
*`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.
16
21
17
22
## Commands Related to Attachments
18
23
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.
20
28
21
29
## Example with SendMessageCommand
22
30
23
31
Here is an example on how to define a command in the ViewModel and bind the `SendMessageCommand` to it:
24
32
25
-
**1.** Add the command's `Execute` method.
33
+
1. Add the command's `Execute` method.
26
34
27
35
<snippetid='chat-commands-executemethod' />
28
36
29
-
**2.** Define the `RadChat` component:
37
+
2. Define the `RadChat` component:
30
38
31
39
<snippetid='chat-commands-xaml' />
32
40
33
-
**3.** Add the ViewModel:
41
+
3. Add the ViewModel:
34
42
35
43
<snippetid='chat-commands-viewmodel' />
36
44
45
+
## Example with AttachFilesCommand
46
+
47
+
1. Define the `RadChat` component:
48
+
49
+
<snippetid='chat-attachments-xaml' />
50
+
51
+
2. Add the `ViewModel` with the `AttachFilesCommand` definition:
52
+
53
+
<snippetid='chat-with-attachments-view-model' />
54
+
55
+
3. Create a sample `MessageItem` model:
56
+
57
+
<snippetid='chat-message-item' />
58
+
59
+
4. Create `AttachmentsItem` class and define the attachments collection property:
60
+
61
+
<snippetid='chat-attachments-item' />
62
+
63
+
5. Define an `AttachmentData` class to hold the attachment information:
64
+
65
+
<snippetid='chat-attachment-data' />
66
+
67
+
6. Define the custom class for the attachments file data:
68
+
69
+
<snippetid='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
+
<snippetid='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:
Copy file name to clipboardExpand all lines: controls/chat/events.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,12 @@ Here is a list of the available events:
14
14
15
15
*`SendMessage`—Raised when a message is sent from the chat by the current author (by clicking the send message button or pressing Enter).
16
16
*`AttachFiles`—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
+
17
20
*`RemoveAttachedFile`—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`.
Copy file name to clipboardExpand all lines: controls/chat/items/attachments.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,4 +8,4 @@ slug: chat-attachments
8
8
9
9
# Attachments
10
10
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.
Copy file name to clipboardExpand all lines: controls/chat/overview.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,8 @@ The Telerik UI for .NET MAUI Chat is a UI component that enables the implementat
15
15
## Key Features of the .NET MAUI Chat
16
16
17
17
*[A variety of chat items for great user experience]({%slug chat-items-overview %})—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%})—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)—The Chat control supports speech-to-text functionality, which allows users to dictate their messages instead of typing them.
18
20
*[Typing indicator]({%slug chat-typing-indicator%})—Use the typing indicator to let the users that other Chat participants are currently typing.
19
21
*[Template Selectors]({%slug chat-itemtemplate-selector%})—Apply different templates to each Chat items.
20
22
*[Predefined List of Suggestions]({%slug chat-suggested-actions%})—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.
Copy file name to clipboardExpand all lines: controls/chat/styling/buttons.md
+13-5Lines changed: 13 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ This section describes how to style the send, more and speech to text buttons in
13
13
14
14
## Style the Send Button
15
15
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.
17
17
18
18
The example below shows how to customize the Send button in your Chat control.
19
19
@@ -32,17 +32,25 @@ The example below shows how to customize the Send button in your Chat control.
32
32
33
33
## Style the More Button
34
34
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`.
36
40
37
41
*`AutoGenerateMoreButtonActions `(`bool`)—Defines whether to automatically generate default actions for the 'More' button. The default value is `true`.
38
42
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.
40
46
41
47
## Style the SpeechToTextButton
42
48
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.
44
52
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.
Copy file name to clipboardExpand all lines: controls/chat/styling/entry.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,7 +37,7 @@ The example below shows how to customize the chat entry in your Chat control. Th
37
37
38
38
## Customize the Send Button
39
39
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.
41
41
42
42
The example below shows how to customize the Send button in your Chat control.
0 commit comments