Windows phone 7.1 ListPicker, easy way to go full mode?

后端 未结 2 1409
终归单人心
终归单人心 2021-01-07 19:21

I\'m trying to use the ListPicker controller with ListPickerMode=\"Full\", to get the fullscreen pick window. However it just generate an error whe

2条回答
  •  醉梦人生
    2021-01-07 19:47

    As stated in the issue tracker of the silverlight toolkit [1], ItemCountThreshold should not be set (and cannot be set using simple xaml).

    However, there are two workarounds for this issue. If you you don't mind to use codebehind, set the property via SetValue:

    //e.g., in the constructor, just after InitializeComponent();
    ListPicker.SetValue(Microsoft.Phone.Controls.ListPicker.ItemCountThresholdProperty, 0);
    

    To set the value in xaml, you can use a binding:

    (...)
    

    In this example, I use a bogus binding expression and set the value using FallbackValue. Of course, an actual working binding should work as well. The xaml approach was only tested on the WP8 SDK, however it should work on 7.1 as well.

    Edit: Just found out that the xaml approach breaks the designer.

    [1] http://silverlight.codeplex.com/workitem/9742

提交回复
热议问题