Delete styles not used in the resource dictionary

I have a pretty large resource dictionary, and I was wondering if there is an easy way to clear it by deleting an unused element (style, brushes, etc.).

+4
source share
1 answer

If this is a single file, the easiest way would be to use ReSharper (you can get a free trial). ReSharper does a pretty good job of understanding when things are not being used and unload them. You can collapse the document and then expand only the root nodes and just delete the ones that are grayed out.

Without ReSharper, this is a little trickier. You can go through and find everything in the solution for each Keyed resource and unlock those that are not found. For implicit resources without keys, it will be a little harder to define (I don't think R # can handle this well)

+5
source

All Articles