XAML Pad implementation using declarative XAML, custom controls etc.
XamlPresenter is a control implementing underlying XAML parsing/presenting. XamlViewer is a neat and simple templated control that uses XamlPresenter to show parsed XAML or displays the syntax error details.
The components are reusable. To add runtime XAML 'debugging' module for WPF application, put a XamlViewer instance in your window and bind its Xaml property to a TextBox. You won't need to define namespaces, they're added automatically. You can look into EditorWindow for a basic simple example.
These details are provided for information only. No information here is legal advice and should not be used as such.