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. 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 tab buttons to SelectCommand and visibility to CurrentKey.
// Hub handlers: CoalescingDispatcher (marshal + coalesce).