Use StreamReader to detect encoding.
Use StreamReader to detect encoding.

File.WriteAllText by default uses Encoding.Default which changes the encoding for xaml files that are proicessed as VS by default uses UTF8. This change uses the detection capabilities of StreamReader and use the detected encoding to write the output.

grochocki/XamlMagic