I'm using the ListPicker control from the WP7 Toolkit. I want to initially present the list with no items selected. Is there a way of doing this?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
According to this blog entry List Picker works with the idea of "there is always an active selection".
The approach I would follow is to have the first item in the list be you "no selected item" item. With appropriate values (maybe a null id) that you can identify later on.
回答2:
By design ListPicker must have a selected item. If you try to set it to null or set the SelectedIndex to -1 you will get an exception.
标签:
windows-phone-7