I have written following code to validate XAML for duplicate name of controls. But it is not good way of doing because I am using Try for validation.
Please suggest me some good way of validating XAML.
bool validateXAML(byte imageFileToOpen)
if (imageFileToOpen != null)
MemoryStream mysr = new MemoryStream(imageFileToOpen);
StreamReader memoryReader = new StreamReader(mysr);
string xamlString = memoryReader.ReadToEnd(); //String of Xaml code
View Complete Post