0

In vanilla WPF, when I bind a collection of objects to a ComboBox, it displays the the string whatever ToString() of that object returns. However, Caliburn.micro shows a message Cannot find view for.... Since I have numerous ComboBoxes, it'd be tedious to use DisplayMemberPath. Is there any way to tinker with Caliburn's Convention Manager to revert normal behavior for comboboxes?

1 Answers1

1

If I remember correctly, this was the order for drawing/templates in XAML (WPF and UWP):

  • Draw Function of the object
  • explicit template assigned to that instance
  • template assigned to that type
  • the result of .ToString()

If so my best guess is that the framework you are using somehow adds a Template targetting "object" as last entry. How about adding a template to object that just returns .ToString()? That would hopefully pre-empty any fallback template like this.

Christopher
  • 9,634
  • 2
  • 17
  • 31