It is very simple to output debug information on Windows Mobile. You can directly use console. writeline, but this method is not available on Windows Phone. It is actually very simple, that is, a sentence.
System. diagnostics.Debug. Writeline ("Debug message");
The procedure is very simple, and the release version automatically shields the information, which is very practical.ProgramThis method has also been used in the lifecycle video. The following describes why this function is required.
Based on your own experience, there are two reasons:
1. when mvvm is used, events are converted to pre-defined commands. These commands bind Delegate to the XAML during data binding. Therefore, debugging is not allowed during running (the debug version is acceptable ). In fact, this is not the main reason, or the root cause, because one of the characteristics of mvvm is testable (testability), I love TDD very much (unit test-driven development ), more logic should be determined through unit testing instead of printing debug information.
2. When I was dealing with tombstone, now I am developing a Windows Phone 7 program and spend a lot of time on tombstone processing. I think "Tombstone processing" has becomeAvailable programsWithEasy to useImportant differences. So far, I think unit testing tombstone is still very difficult, so Debug. writeline () is my choice.