Skip to content

Commit

Permalink
added more check for renderer overriding
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreiMisiukevich committed Apr 13, 2020
1 parent 4d30136 commit 99ab860
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Reloader/Xamarin.Forms.HotReload.Reloader/HotReloader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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"));

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 99ab860

Please sign in to comment.