Douglas Douglas - 1 year ago 122
C# Question

How do I set a breakpoint inside C# PresentationFramework.dll?

This might be a shot in the dark, but, how would I go about setting a breakpoint inside the following internal static method in PresentationFramework.dll?


I've run into a very similar situation to Joe, where I am making a custom auto-complete textbox using a TextBox control and a Popup which contains an ItemsControl. When I have the focus in the text box and the popup shown with StaysOpen="False", and type some characters, the mouse pointer is hidden (through a call to System.Windows.Documents.TextEditorTyping.HideCursor I believe). It is normally re-shown on mouse move, however it appears that the popup handles this event while it is checking whether it should hide or not, so the pointer stays hidden as you move it around the window.

There is a quirk, where on the first key press, the pointer disappears then instantly reappears, then on the second key press, the pointer stays hidden. This suggests that something is calling _ShowCursor(), and I am interested to know what. Hence this post, and the desire to set the breakpoint described above. How do I set that breakpoint?

Regarding my actual problem, the pointer staying hidden once it moves, I hope to solve it either by emulating StaysOpen="False" myself without blocking mouse move events, or to fire mouse move events myself to cause the pointer to reappear. Any other tips on this appreciated.

x0n x0n
Answer Source

While you cannot do this with the stock framework (no debug symbols available,) you can get this kind of trickery working with Reflector Pro:

Reflector Pro will disassemble the WPF assemblies into .cs source files, and generate it's own debug PDB on the fly - you then then single-step with Visual Studio through the Presentation Framework assembly (and set breakpoints)

good luck!

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download