awesome-inc / FontAwesome.Sharp

A library for using Font Awesome in WPF & Windows Forms applications
Apache License 2.0
376 stars 87 forks source link

IconImage: Exception when Foreground is set before Icon #83

Open felsenbirne opened 2 years ago

felsenbirne commented 2 years ago

Describe the bug When using IconImage from the FontAweseome.Sharp.Pro NuGet package and when the Foreground-Property is set before the Icon-Property following Exception is thrown during the InitializeComponent of the containing View:

Exception thrown at 0x00007FF812904F69 (KernelBase.dll) in Application.exe: 0xC0000005: Access violation reading location 0x0000000000000000.

When setting the Icon before the Foreground or using the IconImage from the FontAwesome.Sharp Nuget everything works fine.

To Reproduce Steps to reproduce the behavior:

  1. Add following control to Existing or new View: <faPro:IconImage Foreground="Black" Icon="Cog" />
  2. Start Software and open View
  3. The descriped Exception should be thrown

Desktop: