5

I am finding myself working with ObservableCollection quite a bit. I've looked around, but I can't seem to find an ObservableCollection Debug Visualizer.

Does such a thing exist?

AngryHacker
  • 59,598
  • 102
  • 325
  • 594
  • Why would a visualizer for `ObservableCollection` be any different than visualizer for any `IList`? Or would that be enough? – svick Jun 14 '11 at 22:36
  • @svick When debugging the visualizer appears for List, but not for ObservableCollection. – AngryHacker Jun 14 '11 at 22:37
  • [I don't see any difference between the two](http://i.imgur.com/ChfAm.png). Maybe you have some special visualizer for `List`? – svick Jun 14 '11 at 22:50
  • @svick. Wow, you are partially correct. I can see the visualizer fine in a Console app project. But I am in a Windows Phone 7 project and all it shows me is [this](http://imgur.com/g6e2S). – AngryHacker Jun 14 '11 at 23:49

1 Answers1

5
  1. Here's a commercial tool for $50... Mole 2010

  2. You could override the .ToString() for the class that you are wrapping with ObservableCollection.

  3. Otherwise, you can tweak what the visualizer shows you with the DebuggerDisplayAttribute.

    [DebuggerDisplay("Employee ( {FullName} )")]
    public class Employee
    {
        ...
    }
    
  4. And if that's not enough, you can write your own visualizer. There are tons of articles out there for that.

    a. MSDN Magazine: DataTips, Visualizers and Viewers Make Debugging .NET Code a Breeze

    b. MSDN Library: How to: Write a Visualizer

    c. MSDN Forums: How do I implement a custom debug visualizer?

    d. Code Project: A Generic List and Dictionary Debugger Visualizer for VS.NET

    e. Code Project: Create a Debugger Visualizer in 10 Lines of Code

slugster
  • 49,403
  • 14
  • 95
  • 145
Jason
  • 4,897
  • 2
  • 33
  • 40