HotReloadService

Since v2.10
public static class HotReloadService
Enables hot reload functionality in Eto

Properties

Enabled

#
public static bool Enabled { get; }
Gets a value indicating whether hot reload is enabled.

Methods

Initialize

#
public static void Initialize()
Initializes hot reload of controls, if it is supported.
Remarks: Code-based hot reload will only work when a debugger is attached. This will also enable support to hot reload xeto and jeto files if in use. Note that at the time of this writing, code based hot reload only works with Visual Studio 2022 on Windows.

WatchFile

#
public static bool WatchFile(object control, string fileName, Action<object> onChanged, string? sourcePath = null)
Watches a file for changes and triggers the specified action when it changes.
control (object)Control to trigger changes to
fileName (string)File to watch for changes
onChanged (Action<object>)Action to invoke when the file changes
sourcePath (string? = null)Source path of the file
true if the file is being watched, false otherwise

WatchFile

#
public static bool WatchFile(object instance, string fileName, string? sourcePath = null)
Watches a file for changes and triggers the method specified in the HotReloadAttribute when it changes.
instance (object)Object to trigger changes to
fileName (string)File to watch for changes
sourcePath (string? = null)Source path of the file
true if the file is being watched, false otherwise