Skip to content

Commit

Permalink
Update AppBuilderExtensions.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
brminnick committed Nov 13, 2023
1 parent d1825b6 commit 4e284fd
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/CommunityToolkit.Maui.Markup/AppBuilderExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace CommunityToolkit.Maui.Markup;
using System.Diagnostics;

namespace CommunityToolkit.Maui.Markup;

/// <summary>
/// <see cref="MauiAppBuilder"/> Extensions
Expand All @@ -12,11 +14,14 @@ public static class AppBuilderExtensions
/// <returns><see cref="MauiAppBuilder"/> initialized for <see cref="CommunityToolkit.Maui.Markup"/></returns>
public static MauiAppBuilder UseMauiCommunityToolkitMarkup(this MauiAppBuilder builder)
{
RegisterReloadApplicationEventHandler();
if (Debugger.IsAttached)
{
RegisterReloadApplicationEventHandler();
}

return builder;
}

[System.Diagnostics.Conditional("DEBUG")]

static void RegisterReloadApplicationEventHandler()
{
CommunityToolkitMetadataUpdateHandler.ReloadApplication += ReloadApplication;
Expand Down

0 comments on commit 4e284fd

Please sign in to comment.