开发者

SortDescription with converter

开发者 https://www.devze.com 2023-03-16 11:33 出处:网络
I havelist<Person> Persons Person has ID, something like that:12231d4sa32fd I have a converter that convert the ID to Status: (Ready/Waiting/NotHere).

I have list<Person> Persons

Person has ID, something like that:12231d4sa32fd

I have a converter that convert the ID to Status: (Ready/Waiting/NotHere).

I show the list in a ListView.

Question: How can I 开发者_如何学Pythonsort the ListView by the Person's status ?


One option is to add a Status property to your Person type and bind to that in your grid instead. If you don't wish to add a Status property to your model, then you could create a PersonViewModel instead with this additional property, and bind your grid to a collection of PersonViewModel.

0

精彩评论

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