Unable to cast object of type 'MS.Internal.NamedObject' to custom type

前端 未结 2 1614
不知归路
不知归路 2021-02-05 11:14

I am not new to WPF, but I can\'t figure out this problem:

I use an ObservableCollection that i bind to ComboBoxes, it\'s a

2条回答
  •  隐瞒了意图╮
    2021-02-05 11:47

    1. No need to call RaisePropertyChanged for MyObsCollection, because ObservableCollection internal implements INotifiyProperty Changed.
    2. I think it is Crashing while assign the value(during set call), this will happen when you try to assign a collection of one type collection of another type. You have to create object of the MyCustomType and should be added to the MyObsCollection instead of directly assigning a collection of different type to MyObsCollection

    It would be great if could post the entire code or piece of code where u assign the or add objects to MyObsCollection

提交回复
热议问题