Building a ChatGPT in .NET MAUI Part 2
With the OpenAI service in place, part two is about what users actually see. The ConversationView is split into a top section with branding and buttons to switch between text and image mode, a CollectionView that holds the conversation, and a bottom input area with send and voice buttons.
A few details stand out. A Lottie animation plays while the message list is empty and stops once a message is sent or received. Two data templates, UserMessageItemTemplate and BotMessageItemTemplate, keep the user’s messages visually distinct from the bot’s. Tapping the branding runs a SelectTheme command that toggles light and dark mode with a short ScaleTo animation.
Daniel also traces how the mode buttons drive the ViewModel’s AskQuestion and CreateImage commands through a shared QueryManagerAsync method, using the MVVM Toolkit. If you’re building a chat-style interface, the structure is easy to borrow.