C# UI and .NET Hot Reload - A Match Made in .NET MAUI
XAML Hot Reload is great until an edit forces you to stop and restart the debugger. David’s answer is to stay in C#, but there’s a catch: after you change UI code, something has to run that code again before you see the result.
His approach starts with a Build() method that sets the page’s Content. A small HotReloadService class, registered with MetadataUpdateHandlerAttribute in debug builds, raises an event after every hot reload. The page subscribes in OnNavigatedTo, unsubscribes in OnNavigatedFrom, and calls Build() on the main thread each time the event fires.
One detail to keep in mind is that XAML Hot Reload still needs to be enabled in your tooling, because the event travels over the same service. David also includes a short video where he adds a new class file mid-session without restarting, so you can see how far the technique goes.