Posted by: MarkWPF
Should you find yourself in a position where you have localised your WPF application, and then wish you hadn’t, you will find yourself needing to remove all the attributes put in by the localisation process.
For those who have yet to experience that, the attribute that is added is x:Uid, like so:
<TextBlock x:Uid=”txtMyTextField” />
The awkwardess is presented by the fact that you want to not only find the attribute in every single xaml element, but to remove the value of the attribute as well.
The first thought I had, no doubt like many others, was that seems pretty basic functionality for search and replace in any xml editor. So I tried my favourite one – no good.
Therefore I tried lots, from basic to industry leaders – even some that half promised on their websites didn’t
So, I fell back to the last resort which was a regex search and replace in visual studio – which worked, though it’s a whole lot scarier!
Here it is for those looking:
which includes the colon and the underscore in the search pattern