It is proven that we software developers spend more time debugging than actually writing code. Guess what?!! WPF is no different… We have to debug and debug and debug!
- How to see the meaningful content of this exception. read more.
- Wpf mentor write an attached property for giving the detail info in an XamlParseExcetion. read more.
- Marlon Grech wrote a Markup Extension that you can use in your DataBinding that will auto magically break in Visual studio so that you can see your binding value. Your markup would look similar to this. read more.
- Corrado Cavalli wrote another article on the PresentationTraceSources feature of .Net 3.5 giving some more insights.
- VS2010 has a control on the trace setting.
Wpf mentor give some ideas on tracing how trigger works in article How to debug triggers using Trigger-Tracing
Tools, tools and more tools…
Snoop is a tool that can you can use to hook to your running WPF application and browse the Visual Tree of the application. You can also inspect and edit the properties, inspect routed events (including the elements that handle them) and magnify sections in the UI.
Mole is a tool that integrates with Visual Studio (also available as a standalone app in the near future) that lets you inspect the Visual Tree of your application, inspect and edit properties, view the XAML for selected elements, preview a snapshot image of individual elements and much much more .
Performance Profiling Tools for WPF. These are a set of tools provided by Microsoft that allow you to analyze the run-time behaviour of your application and determine the types of performance optimizations you can apply .
Reflector is the class browser, explorer, analyzer and documentation viewer for .NET. Reflector allows to easily view, navigate, search, decompile and analyze .NET assemblies in C#, Visual Basic and IL. There is also a plugin related to WPF for Reflector called BAMLViewer which enables the user to see the XAML embedded in the assemblies being analayzed.
More tips and tricks…
- Josh Smith wrote a very interesting article where he gives some tips on debugging databinding and also on how to dig into exceptions that are thrown on runtime (ex: invalid StaticResources ) read more.
Most resource come from this article, however i wish to keep adding staff that i find.