简体   繁体   中英

WPF binding on generic list

In my WP8 project, using MVVM, I bind an object to the View. That object has a generic list which I need to bind on a LongListSelector . Since I cant convert my list to observable, how can I bind it and have a TwoWay update?

Example of my object:

Class: Person

Properties:

  • ID - int
  • Name - string
  • Groups - List of Groups . This is the property I need to bind on the LongListSelector

.

## UPDATE 1: ##

In short my problem is that I have an object with a List as navigation property (not observable collection). What is the Best Practice when you want to bind that List Navigation Property on the View.

Thanks to all comments from the guys, I ended up that it was inevitable after all to insist with generic list. I changed my list to ObservableCollection and everything is ok now.

I guess the answer credits should go to Clemens, Cédric Bignon and tanuj_loop

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM