0

How to change custom ComboBox theme in WPF? I tried to change theme of whole application but my DerivedComboBox keeps using Windows 8 theme(it works good for normal ComboBox). It works when I put DerivedComboBox into UserControl but I would like to avoid that.

ahaw
  • 221
  • 2
  • 10
  • 1
    what does your DerivedComboBox do? I can only image few (valid) reasons to subclass the WPF Controls. – Federico Berasategui Feb 17 '13 at 12:49
  • I need to know LastSelectedItem. – ahaw Feb 17 '13 at 12:53
  • 1
    That's a `Data` concept, it should be a responsibility of the ViewModel, not the View. That's not a valid reason to subclass the ComboBox. Create a proper ViewModel that knows what the last selected Item was, and operate against the ViewModel, not the View. [UI is Not Data](http://stackoverflow.com/questions/14381402/wpf-programming-methodology/14382137#14382137) – Federico Berasategui Feb 17 '13 at 13:34
  • 1
    Yeah.. becouse your CB style has target type CB... you have to provide style with targetType DerivedComboBox, but you really should do what HighCore told you. – Kapitán Mlíko Feb 17 '13 at 16:16
  • @HighCore There is no mention of the MVVM. – Kapitán Mlíko Feb 17 '13 at 16:18

0 Answers0