开发者

How to extract an instance of ObjectTypeA encapsulted in an general object? - screenshot attached

I am implementing an eventhandler for ObservableCollection of Product.

I have a NotifyCollectionChangedEventArgs e. e.NewItems[0] returns the first object that has been changed. But this is an object, meaning it is not a Product, the Product is encapsulated in the object somehow, but I am not sure how to e开发者_如何学Pythonxtract the Product from this object.

tempPVM is of type "ObjectTypeA" :)

Please refer the following screenshot. :)

How to extract an instance of ObjectTypeA encapsulted in an general object? - screenshot attached


The object is the product - it's just not statically typed that way. You can just cast:

Product firstNewProduct = (Product) e.NewItems[0];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜