Use below code to show Error in message box
public partial class ErrorWindow : ChildWindow
{
public ErrorWindow(Exception e)
{
InitializeComponent();
if (e != null)
{
ErrorTextBox.Text = e.Message + Environment.NewLine + Environment.NewLine + e.StackTrace;
}
}
}