Skip to content

Commit

Permalink
Don't attach DotNetPatchHelper in design mode
Browse files Browse the repository at this point in the history
  • Loading branch information
GeertvanHorrik committed Oct 17, 2024
1 parent 85a4870 commit 2b3d653
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/Orchestra.Core/Helpers/DotNetPatchHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Threading;
using Catel;
using Catel.Logging;

/// <summary>
Expand All @@ -28,6 +29,11 @@ public static class DotNetPatchHelper
/// </summary>
public static void Initialize()
{
if (CatelEnvironment.IsInDesignMode)
{
return;
}

Attach();
}

Expand All @@ -45,6 +51,11 @@ public static void Detach()

private static void AttachToAppDomain()
{
if (CatelEnvironment.IsInDesignMode)
{
return;
}

if (_isAppDomainInitialized)
{
return;
Expand Down Expand Up @@ -77,6 +88,11 @@ private static void DetachFromAppDomain()

private static void AttachToApplication()
{
if (CatelEnvironment.IsInDesignMode)
{
return;
}

if (_isApplicationInitialized)
{
return;
Expand Down

0 comments on commit 2b3d653

Please sign in to comment.