Skip to content
Nuvyntra Labs

Documentation

Chat host

NavigationPage replace-root, SectionHostView tabs, SnapshotCollection, and SearchQuery.CommittedText.

Chat-style host

A WhatsApp-style app is one persistent screen, in-place tabs, a filterable inbox, and a thread on a NavigationPage stack. That is not a Shell + PagedCollection + appear/refresh app. Bind SectionHostView to SelectCommand and CurrentKey — do not write visibility flippers in code-behind. Auth and forms stay on FormViewModel / IAuthState / UseAuth.

Reference app: WhatsApp clone using MVVMExpress Framework

builder.UseMvvmExpress(o =>
{
    o.UseNavigationPage((nav, _) => nav
        .Map<LoginViewModel, LoginPage>("login")
        .Map<ChatHostViewModel, ChatHostPage>("chats")
        .Map<ChatThreadViewModel, ChatThreadPage>("thread"));
    o.UseDialogs();
    o.UseAuth<LoginViewModel>();
});

await Navigator.ResetAsync<ChatHostViewModel>();
await Navigator.NavigateToAsync<ChatThreadViewModel, ChatNavArgs>(new(id));
public sealed class ChatHostViewModel : SectionHostViewModel
{
    public ChatHostViewModel()
    {
        Inbox = Add("chats", new ChatInboxViewModel(seed));
        Add("updates", new ChatInboxViewModel([]));
    }

    public ChatInboxViewModel Inbox { get; }
}

// Bind SectionHostView to SelectCommand and CurrentKey.
// Hub handlers: CoalescingDispatcher (marshal + coalesce).

Discussion

Comment on Plugin.Maui.MVVMExpress. The thread lives on this component's GitHub repository (nuvyntralabs/Plugin.Maui.MVVMExpress). Sign in with GitHub — Giscus uses Discussions, Utterances uses Issues.