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

后端 未结 2 1407
终归单人心
终归单人心 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:42

    The solution proposed by the author (moving here for better visibility):

    Well it looks like ItemCountThreshold & ListPickerMode was remove for 7.1 or something, atleast in XAML part, not the C# part, where they are read only.

    Solution for my problem!

    <toolkit:ListPicker x:Name="OutputSelector" ExpansionMode="FullScreenOnly"   
    Margin="0,542,6,0" Header="Output Type" Width="450" VerticalAlignment="Top" />
    

    The ExpansionMode will make the Listpicker appear in fullscreen or expanded.

    0 讨论(0)
  • 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:

    <toolkit:ListPicker ItemCountThreshold="{Binding Hugo,FallbackValue=0}">(...)
    

    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

    0 讨论(0)
提交回复
热议问题