How to find the stack trace for databinding? Answer

time to read 1 min | 137 words

This is a rather special request, I’ll admit. For reasons of my own, I need to find the method(s) called to actually performed data binding in WPF & WinForms.

WPF is actually quite simple:

image

WinForms, not so much. I resorted to creating a strongly typed data source and concating my extension there.

image

The answers are, by the way:

WPF:

  • at MS.Internal.Data.DataBindEngine.Task.Run(Boolean lastChance)
  • at MS.Internal.Data.DataBindEngine.Run(Object arg)

WinForms:

  • at System.Windows.Forms.CurrencyManager.SetDataSource(Object dataSource)
  • at System.Windows.Forms.BindingContext.EnsureListManager(Object dataSource, String dataMember)