charri / Font-Awesome-WPF

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

Don't spin when opacity zero #37

Closed krzysztofdul closed 7 years ago

krzysztofdul commented 7 years ago

Improve performance when opacity set to zero.

krzysztofdul commented 7 years ago

I revised this a bit to make it simpler, using coercion and overriding property metadata. Please take a look at the updated PR.

In my app we fade a loading spinner out, leaving it in the logical tree with opacity zero. Without the change in this PR you can see quite a bit of GPU usage in Process Explorer, even though the UI element is not actually visible. With this PR, GPU usage falls to zero and the app feels a lot more responsive.

Would you be able to review this and, if you merge it, get an updated build on NuGet? We're blocked on this right now and don't want to fork the project on NuGet.

drewnoakes commented 7 years ago

Just seen this released as https://www.nuget.org/packages/FontAwesome.WPF/4.7.0.9

Many thanks.