charri / Font-Awesome-WPF

FontAwesome controls for WPF+UWP
MIT License
530 stars 147 forks source link

Problem with multiple views in UWP #48

Open theescapers opened 7 years ago

theescapers commented 7 years ago

On using the FontAwesome controls in XAML in multiple views, I am getting crashes. I looked at the code, and I believe the problem to be the use of a static FontFamily object which is getting shared across multiple dispatcher threads.

I tried replacing this shared FontFamily object with a ConcurrentDictionary with the dispatcher as key, and FontFamily as value, which means each dispatcher thread gets it's own FontFamily. This resolved my problem, and I'd be happy to commit the fix.