In this post I'll describe the way to handle the exceptions in Silverlight. Whereas running the Silverlight application, if any exception happens it'll attend Silverlight.js and show within the internet explorer as a javascript error. Within the debugging purpose of read typically it's cumbersome to see wherever truly the exception happened.

This is an easy user control that has an easy textbox:
FontFamily="Courier New"
FontSize="12" IsReadOnly="True" HorizontalScrollBarVisibility="Auto" />

This class are used to print the exception and notice the stacktrace. it's an enum for the exception types viz. DEBUG,INFO,WARN,ERROR and FATAL.This class contains an easy delegate to add text to the log window.
The static property _instance is about by the LogWindow.xaml.cs go in the load event as:
Logger._instance = logText;
So that it will print whatever exception happenes in your application. The LogException methodology expects exception object because the parameter and find the exception information using the StackFrame class.

StackFrame frame = new StackFrame(true);
callerSignature =  string.Format("@{0}:{1}:{2}", frame.GetMethod(), frame.GetFileName(), frame.GetFileLineNumber());

To use this method in your catch block you just simply need to call the static method as:
Catch(Exception ex)

Hope this tutorial works for you!