From 99ab86094b64133045e9fc95c524289acdff4e69 Mon Sep 17 00:00:00 2001 From: Andrei Misiukevich Date: Tue, 14 Apr 2020 01:27:23 +0300 Subject: [PATCH] added more check for renderer overriding --- Reloader/Xamarin.Forms.HotReload.Reloader/HotReloader.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; }