Robert
Robert

Reputation: 6226

Remove Styles Not Used In Resource Dictionary

I have a pretty large resource dictionary and I was wondering if there was an easy way to clean it up by removing any unused element (style, brushes, etc)

Upvotes: 4

Views: 697

Answers (1)

Brad Cunningham
Brad Cunningham

Reputation: 6501

If it 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 grays them out. You can collapse the document and then expand only the root nodes and just whack the ones that are grayed out.

Without ReSharper, it is a little tougher. You could go through and do a find all in the solution for each Keyed resource and wack those that aren't found. For implicit resources without keys it will be a little tougher to determine (I don't think R# can even handle these well)

Upvotes: 5

Related Questions