Debugging in WPF – WPF Disciples tips and tricks

4 04 2008

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! So the WPF Disciples decided to make a list of articles that can help WPF developers make the debugging process easier.

Debugging DataBinding

- 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.

{Binding Path=Height, Converter={local:DebugBinding}}

- Beatriz Costa blogged on how you can enable tracing in your data binding by using a new WPF Feature of .Net 3.5. So basically you can do something like this in your data binding… read more.

<TextBlock Text=“{Binding Path=Caption, diagnostics:PresentationTraceSources.TraceLevel=High}” />

- Corrado Cavalli wrote another article on the PresentationTraceSources feature of .Net 3.5 giving some more insights.

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.

You may also want to write your own tool that integrates with Visual Studio to do your own thing, here is a brilliant article from Karl Shiflett on how to create a debugger visualizer.

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.

- Shawn Burke blogged on how one can configure Visual Studio to debug .Net framework source code. Read more ….

Do you have any other tips/tricks of debugging WPF applications? then post a comment and share your knowledge with the rest of the WPF Community.

kick it on DotNetKicks.com

About these ads

Actions

Information

21 responses

4 04 2008
Josh Smith

Nice job! This should be very helpful for a lot of people new to WPF.

-josh

4 04 2008
marlongrech

yea, the WPF Disciples ROCK!!!!!!!

5 04 2008
Andrew Smith

NIce work. We should probably also include a link to the article discussing how to setup vs to be able to debug the .net source code: http://blogs.msdn.com/sburke/archive/2008/01/16/configuring-visual-studio-to-debug-net-framework-source-code.aspx
-Andrew

5 04 2008
marlongrech

good idea, thanks for pointing it out :)

10 04 2008
Debugging in WPF « Rams On It - .NET

[...] Debugging in WPF 10 Apr 2008 Posted by ramsonit in WPF. trackback Yes!!! debugging is part of the developer life whatever may be the technology, WPF disciples has written a great article about debugging in WPF. [...]

23 01 2009
WPF Mentor

Here’s a useful technique for debugging/tracing triggers effectively. It allows you to log all trigger actions along with the element being acted up.

http://www.wpfmentor.com/2009/01/how-to-debug-triggers-using-trigger.html

25 05 2009
David Sackstein

Tips and Tricks: Synchronizing asynchronous events onto a window thread

http://blogs.microsoft.co.il/blogs/davids/archive/2009/04/27/isynchronizedinvoke-and-wpf.aspx

3 06 2011
walmuto68

Brilliant post! I’ve bookmark this site to return later. cheers! (i>Z- cheapest proactol Hzc’S

28 09 2011
kurs bhp

you’re really a good webmaster. The website loading speed is incredible. It seems that you’re doing any unique trick. In addition, The contents are masterwork. you have done a wonderful job on this topic!

13 12 2011
Suk Treworgy

This web site is known as a walk-by way of for all the data you needed about this and didn’t know who to ask. Glimpse right here, and you’ll positively uncover it.

4 09 2012
loanntt

Your blog is very good. I like your blog.

5 09 2012
mia

A blog good and interneting

30 11 2012
visitvietnamjourney

I wondere if there are people out there with experience of WPF application development – and maybe more interesting – running WPF in production.

9 06 2013
miracle mastery

Very descriptive blog, I liked that a lot. Will there be
a part 2?

28 07 2013
http://www.exrecoverysystem.com

Hello! I simply would like to give you a huge thumbs up for the excellent info you’ve got here on this post. I will be coming back to your web site for more soon.

23 08 2013
http://optimagery.blogspot.com/2013/07/trick-photography-and-special-effects.html

Hi there outstanding website! Does running a blog similar to this take a lot of work?
I have virtually no knowledge of computer programming however I was
hoping to start my own blog soon. Anyway, should you
have any recommendations or tips for new blog owners
please share. I understand this is off subject however I simply had to ask.

Thanks!

13 09 2013
http://dealingwithdepressionblog.blogspot.com/2013/09/linden-method-free-download.html

The following is a look at some of the most common signs that inform about this
condition. Something deep in that has always been
there that is easy accessible with every breath and fills you with confidence
and joy. Non drug treatments are also available for anxiety
disorders, but they are not as effective and fast as medication.

22 09 2013
Insider Internet Dating PDF

Please do not start off any Email with, “I have just seen your profile. Ending your date – never forget to thank your date and avoid giving false impressions. Today we can browse, play games, shop, investigate and more all from the comfort of our own computer.

5 07 2014
scam

I’m gone to inform my little brother, that he should also visit this website on regular basis to take updated from latest reports.

21 09 2014
discours de mariage

Un discours de mariage rédigé en bon français, foncez!

30 09 2014
tub showers

tub showers

Debugging in WPF – WPF Disciples tips and tricks | WPF Disciples

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




Follow

Get every new post delivered to your Inbox.

Join 30 other followers

%d bloggers like this: