Skip to content
Shiny Controls v1.0 - The Ultra Control Suite for .NET MAUI & BlazorO...M...G!

ChatView | API Reference

Namespaces are mirrored: Shiny.Maui.Controls.Chat and Shiny.Blazor.Controls.Chat. Models are identical across platforms except ChatSessionUserInfo (MAUI uses ImageSource/Color; Blazor uses string URL / CSS color).

Member Returns Description
CreateSessionAsync(string[] userIds, CancellationToken) Task<IChatSession> Create a new session for the given users
GetSessionAsync(string sessionId, CancellationToken) Task<IChatSession> Resolve an existing session; throws ChatSessionException if missing/forbidden
Member Type Description
Info ChatSessionInfo Always current; refreshed before SessionUpdated fires
CurrentUserId string Who “me” is — drives bubble alignment + ownership
Member Returns Description
GetMessagesAsync(string? cursorMessageId, MessagePageDirection direction, int count, CancellationToken) Task<MessagePage> Cursor paging; null + Older = newest page
SendMessageAsync(OutgoingMessage, CancellationToken) Task<ChatMessage> Send; echo carries the same ClientMessageId
ResendMessageAsync(string clientMessageId, CancellationToken) Task<ChatMessage> Retry a Failed message
EditMessageAsync(string messageId, string body, CancellationToken) Task Edit own message
DeleteMessageAsync(string messageId, CancellationToken) Task Delete own message
ReactToMessageAsync(string messageId, string emoji, bool add, CancellationToken) Task Toggle a reaction on/off
MarkReadAsync(string[] messageIds, CancellationToken) Task Mark messages read (control passes only visible, not-mine, unread ids)
ToggleTypingAsync(bool isTyping, CancellationToken) Task Report the current user’s typing state
InviteUserAsync(string userId, CancellationToken) Task Invite a user
LeaveAsync(CancellationToken) Task Leave the session
RenameAsync(string sessionName, CancellationToken) Task Rename the session
Event Args Description
MessageReceived ChatMessage New inbound message or own-send echo (multi-device)
MessageUpdated MessageChanged Edit / reaction / receipt / status change
MessageDeleted string Deleted message id
UserTyping UserTypingEvent Remote user typing state
UserJoined ChatSessionUserInfo A user joined
UserLeft ChatSessionUserInfo A user left
SessionUpdated ChatSessionInfo Name / users / permitted emojis / permissions changed
ConnectionStateChanged ChatConnectionState Connectivity changed

Events may fire off the UI thread — the control marshals them.

public record ChatMessage(
string MessageId,
string? ClientMessageId,
string SenderId,
string? Body,
string? ImageUrl,
MessageStatus Status,
string? StatusReason,
DateTimeOffset Timestamp,
DateTimeOffset? EditedTimestamp,
IReadOnlyList<Reaction> Reactions,
IReadOnlyList<ReadReceipt> ReadReceipts,
string? Identifier = null,
IReadOnlyDictionary<string, string>? Metadata = null
);
public record Reaction(string UserId, string Emoji, DateTimeOffset Timestamp);
public record ReadReceipt(string UserId, DateTimeOffset Timestamp);
public record MessageChanged(ChatMessage Message, MessageChangeKind Change);
public record MessagePage(IReadOnlyList<ChatMessage> Messages, bool HasMore); // Messages always chronological asc
public record OutgoingMessage(string? Body, OutgoingAttachment? Attachment = null, string ClientMessageId = "");
public record OutgoingAttachment(ChatAttachmentKind Kind, Stream Content, string FileName, string ContentType);
public record ChatSessionInfo(
string SessionId,
string SessionName,
ChatSessionUserInfo[] Users,
string[]? PermittedEmojis,
MessageBodyPermissions BodyPermissions,
ChatSessionPermissions Permissions,
DateTimeOffset CreatedAt,
DateTimeOffset? LastReadDate,
int UnreadMessageCount
);
// MAUI
public record ChatSessionUserInfo(string UserId, string DisplayName, ImageSource? Avatar, Color? BubbleColor, DateTimeOffset JoinedDate);
// Blazor
public record ChatSessionUserInfo(string UserId, string DisplayName, string? AvatarUrl, string? BubbleColor, DateTimeOffset JoinedDate);
public record UserTypingEvent(string UserId, bool IsTyping, DateTimeOffset Timestamp);
public enum MessageStatus { Sending, Sent, Delivered, Read, Failed, Rejected }
public enum MessageChangeKind { Edited, ReactionChanged, ReadReceiptChanged, StatusChanged }
public enum MessagePageDirection { Older, Newer }
public enum ChatAttachmentKind { Image } // Video/Audio/File reserved
public enum ChatConnectionState { Connected, Reconnecting, Offline }
public enum SendRejectionKind { MessageTooLarge, TooManyAttachments, AttachmentTooLarge, UnsupportedContent, NotPermitted, Other }
[Flags]
public enum ChatSessionPermissions
{
None = 0,
CanSendMessages = 1,
CanEditMessages = 2,
CanDeleteMessages = 4,
CanReactToMessages = 8,
CanInviteUsers = 16,
CanLeaveSession = 32,
CanChangeSessionName = 64,
CanSendImages = 128,
Default = CanSendMessages | CanSendImages | CanReactToMessages | CanInviteUsers | CanLeaveSession,
All = CanSendMessages | CanEditMessages | CanDeleteMessages | CanReactToMessages
| CanInviteUsers | CanLeaveSession | CanChangeSessionName | CanSendImages
}
[Flags]
public enum MessageBodyPermissions
{
None = 0,
Links = 1, Bold = 2, Italics = 4, Underline = 8, Strikethrough = 16, Codeblocks = 32,
All = Links | Bold | Italics | Underline | Strikethrough | Codeblocks
}
public class ChatSessionException : Exception { } // GetSessionAsync: missing/forbidden session
public class ChatSendRejectedException : Exception // send refused — bubble => Rejected, no retry
{
public SendRejectionKind Kind { get; }
}
Property Type Default Notes
Provider IChatSessionProvider? null The integration provider
SessionId string? null Session resolved via GetSessionAsync
PageSize int 30 Messages fetched per page
OpenImagesInViewer bool true Tap an image bubble → built-in ImageViewer
MyBubbleColor Color/string #DCF8C6 Local user bubble color
MyTextColor Color/string Black Local user text color
OtherBubbleColor Color/string White Default other-user bubble (overridden by ChatSessionUserInfo.BubbleColor)
OtherTextColor Color/string Black Other-user text color
ChatBackgroundColor Color?/string? null Messages area background
BubbleFontSize double 15 MAUI
BubbleFontFamily string? null MAUI
TimestampFontSize double 11 MAUI
BubbleCornerRadius double 18 Tail corner stays 4 (MAUI)
PlaceholderText string "Type a message..." Input placeholder
SendButtonText string "Send" Send button label
SendButtonBackgroundColor Color? theme MAUI
SendButtonTextColor Color? theme MAUI
InputBarBackgroundColor Color? theme Area behind the composer
InputBarBorderColor Color? theme Outline of the rounded composer (no separator rule)
InputBar ChatEntryView built-in The hosted composer — read to tweak, assign to replace (The Composer) (MAUI)
MaxInputRows int 6 Composer growth cap in lines (Blazor)
InputTemplate RenderFragment? null Replaces the built-in composer (Blazor)
InputLeftToolbar RenderFragment? null Markup on the left of the composer’s control row (Blazor)
InputRightToolbar RenderFragment? null Markup on the right of the control row, before send (Blazor)
IsInputBarVisible bool true false for read-only chats
ShowTypingIndicator bool true Enable typing indicators
ScrollToFirstUnread bool false Anchor initial scroll at first unread (via Info.LastReadDate)
InputActions IList<ChatInputAction> [] Custom input-bar actions (MAUI)
CustomBubbleActions IList<ChatBubbleAction> [] Custom bubble actions appended to built-ins (MAUI)
MessageTemplate DataTemplate? null Single content template (MAUI)
MessageTemplateSelector DataTemplateSelector? null Per-message template (MAUI)
UseFeedback bool true Haptic feedback (MAUI)
AdjustForKeyboard bool true iOS keyboard padding; leave on inside a FloatingPanel (MAUI)
Member Description
ScrollToEnd(bool animate) Scroll to the latest message
ScrollToMessage(string messageId, bool animate) Scroll to a message by id
SubmitEntry() Programmatically submit the input text
EntryText (property) Get/set the input field text
MessageTapped (event) Fires for non-image bubble taps
public class ChatInputAction : BindableObject
{
public string? Text { get; set; }
public ImageSource? Icon { get; set; }
public Func<ChatView, Task>? Handler { get; set; }
public event EventHandler<ChatView>? Clicked;
public virtual Task InvokeAsync(ChatView chatView);
}
public class ChatBubbleAction : BindableObject
{
public string? Text { get; set; }
public ImageSource? Icon { get; set; }
public Func<ChatMessage, Task>? Handler { get; set; }
public event EventHandler<ChatMessage>? Clicked;
public virtual Task InvokeAsync(ChatMessage message);
}

Shiny.Maui.Controls.SpeechAddins ships SpeechToTextTool : ChatInputAction and TextToSpeechBubbleTool : ChatBubbleAction — see Custom Actions.