Unless your app dynamically is loading xaml files at runtime, wpf apps usually don't have xaml files around after the app has been compiled.

However, if you app has xaml files after compilation, your approach of parsing them seems reasonable.

Another approach is retrieve this info by walking the component model.