From a8f88f7b0216de8440c2baffc577aea9c7e6994a Mon Sep 17 00:00:00 2001 From: Senne Date: Sat, 20 Nov 2021 14:09:14 +0100 Subject: [PATCH 1/3] Resolves #87 --- FluentWPF/Utility/IconHelper.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/FluentWPF/Utility/IconHelper.cs b/FluentWPF/Utility/IconHelper.cs index e838b6e..0173b08 100644 --- a/FluentWPF/Utility/IconHelper.cs +++ b/FluentWPF/Utility/IconHelper.cs @@ -19,8 +19,10 @@ public static ImageSource AppIcon { if (appIcon == null) { - var path = System.Reflection.Assembly.GetEntryAssembly().Location; - appIcon = GetIcon(path); + var assembly = System.Reflection.Assembly.GetEntryAssembly(); + assembly ??= System.Reflection.Assembly.GetCallingAssembly(); + + appIcon = GetIcon(assembly.Location); } return appIcon; } From dd409a670c1c0b59dfae31749e8db5ea25bf4221 Mon Sep 17 00:00:00 2001 From: Senne Date: Sat, 20 Nov 2021 14:09:43 +0100 Subject: [PATCH 2/3] Remove unused usings --- FluentWPF/Utility/IconHelper.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/FluentWPF/Utility/IconHelper.cs b/FluentWPF/Utility/IconHelper.cs index 0173b08..c690602 100644 --- a/FluentWPF/Utility/IconHelper.cs +++ b/FluentWPF/Utility/IconHelper.cs @@ -1,9 +1,5 @@ using System; -using System.Collections.Generic; -using System.Linq; using System.Runtime.InteropServices; -using System.Text; -using System.Threading.Tasks; using System.Windows; using System.Windows.Media; using System.Windows.Media.Imaging; From 51ae676b3aea0ce2761348600c84fec3e2a5cb06 Mon Sep 17 00:00:00 2001 From: Senne Date: Sat, 20 Nov 2021 14:18:45 +0100 Subject: [PATCH 3/3] Use ExecutingAssembly over CallingAssembly --- FluentWPF/Utility/IconHelper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FluentWPF/Utility/IconHelper.cs b/FluentWPF/Utility/IconHelper.cs index c690602..ab576b7 100644 --- a/FluentWPF/Utility/IconHelper.cs +++ b/FluentWPF/Utility/IconHelper.cs @@ -16,7 +16,7 @@ public static ImageSource AppIcon if (appIcon == null) { var assembly = System.Reflection.Assembly.GetEntryAssembly(); - assembly ??= System.Reflection.Assembly.GetCallingAssembly(); + assembly ??= System.Reflection.Assembly.GetExecutingAssembly(); appIcon = GetIcon(assembly.Location); }