Skip to content

Commit 4e284fd

Browse files
Update AppBuilderExtensions.cs
1 parent d1825b6 commit 4e284fd

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/CommunityToolkit.Maui.Markup/AppBuilderExtensions.cs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
namespace CommunityToolkit.Maui.Markup;
1+
using System.Diagnostics;
2+
3+
namespace CommunityToolkit.Maui.Markup;
24

35
/// <summary>
46
/// <see cref="MauiAppBuilder"/> Extensions
@@ -12,11 +14,14 @@ public static class AppBuilderExtensions
1214
/// <returns><see cref="MauiAppBuilder"/> initialized for <see cref="CommunityToolkit.Maui.Markup"/></returns>
1315
public static MauiAppBuilder UseMauiCommunityToolkitMarkup(this MauiAppBuilder builder)
1416
{
15-
RegisterReloadApplicationEventHandler();
17+
if (Debugger.IsAttached)
18+
{
19+
RegisterReloadApplicationEventHandler();
20+
}
21+
1622
return builder;
1723
}
18-
19-
[System.Diagnostics.Conditional("DEBUG")]
24+
2025
static void RegisterReloadApplicationEventHandler()
2126
{
2227
CommunityToolkitMetadataUpdateHandler.ReloadApplication += ReloadApplication;

0 commit comments

Comments
 (0)