dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
21.84k stars 1.67k forks source link

[Enhancement] Maui Framework should respond to C# Hot Reload events #4592

Open chabiss opened 2 years ago

chabiss commented 2 years ago

Description

Maui does not have an implementation of MetadataUpdateHandler so the UI does not automatically refresh after a code change has been applied

@Joaquin Jares @Jon Dick @Stephane Delcroix

Stephane started an email thread with the summary of the work to be done (Piggy backing on XAML HR for .NET HR communication). This has nothing to do with the runtime proper, but it does require work in both the application side and on the VS side.

VS Side: a message with some payload is send when a .NET HotReload happened XAML HR Bridge: that message is passed along the debug channel, and received on the running agent XAML HR agent: when receiving such a message, it triggers an event on the runtime looks for the MetadataUpdateHandlerAttribute in all loaded assemblies and collects the methods to be called (either cache clearing or other update handling) and calls all the methods (first cache clearing, then update handling) MAUI framework listen to the runtime event, and refreshes pages accordingly registers such a handler to trigger a page referesh.

Public API Changes

N/A

Intended Use-Case

C# Hot Reload on Maui

Redth commented 2 years ago

Related: https://github.com/dotnet/maui/issues/4445

ghost commented 1 year ago

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.