diff --git a/Reloader/Xamarin.Forms.HotReload.Reloader/HotReloader.cs b/Reloader/Xamarin.Forms.HotReload.Reloader/HotReloader.cs index b33e5a8..9afa3c6 100644 --- a/Reloader/Xamarin.Forms.HotReload.Reloader/HotReloader.cs +++ b/Reloader/Xamarin.Forms.HotReload.Reloader/HotReloader.cs @@ -36,6 +36,7 @@ public sealed partial class HotReloader private VisualElement _ignoredElementInit; + private bool _codeReloadingEnabled; private Type _xamlLoaderType; Type XamlLoaderType => _xamlLoaderType ?? (_xamlLoaderType = Assembly.Load("Xamarin.Forms.Xaml").GetType("Xamarin.Forms.Xaml.XamlLoader")); @@ -67,6 +68,7 @@ public ReloaderStartupInfo Run(Application app, Configuration config = null) { config = config ?? new Configuration(); var devicePort = config.DeviceUrlPort; + _codeReloadingEnabled = config.CodeReloadingEnabled; Stop(); App = app; @@ -271,7 +273,7 @@ private void TrySubscribeRendererPropertyChanged(params string[] paths) var hasCodegenAttribute = HasCodegenAttribute(bindable); - if (!_assemblies.Contains(bindable.GetType().Assembly) && !hasCodegenAttribute) + if ((!_assemblies.Contains(bindable.GetType().Assembly) || !_codeReloadingEnabled) && !hasCodegenAttribute) { return; }