How do you bind a ComboBox's SelectedItem to an object that is a copy of an item from ItemsSource?

前端 未结 3 1236
不思量自难忘°
不思量自难忘° 2021-01-02 08:14

I\'m using the MVVM pattern with WPF and have run into a problem, which I can simplify to the following:

I have a CardType model.

public class CardTy         


        
3条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-02 08:59

    A workaround that you could do is to bind your SelectedItem to a string (instead of cardType), then create an object of type CardType using this string?

提交回复
热议问题