This is a debug statement. Removing it will not affect the production code.
However, it uses Dispatcher.CheckAccess () to make sure that you are in the user interface thread during exectution at this point. If you call this method from the background thread, the statement will fail.
Removing it may affect your ability to debug it in the future.