I'm using WPF in a complicated, hard to work with codebase. I have a ComboBox in a UI and its SelectedItem is bound to a property in a viewmodel. When I click a button, the view/viewmodel is changed (intentional - think like a "forward" button). When I click a back button, the original view/viewmodel with the combobox is shown and the SelectedItem is correct. This all works as expected...
I then introduced a ComboBoxWithPlaceholder which is a wrapper for the combobox, and replaced the ComboBox with the ComboBoxWithPlaceHolder. Suddenly, the SelectedItem is being set to null when i click the "forward" button. Looking at the stack trace, it's pretty much starting at Application.Run() and then its all external code until the SelectedItem is set to null.
I took my exact ComboBoxWithPlaceHolder control and placed it in a simple WPF application where I switched viewmodels using a button. Here the SelectedItem is preserved, so the control works as expected.
I guess what I'm asking is for any advanced approaches to debugging something like this? I've tried value converters but as I said, the stacktrace is all external code