Upgrading wp8 to wp8.1 silverlight, Listpicker error upon initialize component

221 Views Asked by At

After I upgraded to Wp8.1 silverlight my listpicker fails during runtime, when InitializeComponent(); is executed.

The WPtoolKit where the listpicker comes from, has been updated, but still in my solution is: \packages\WPtoolkit.4.2013.08.16\lib\wp8\Microsoft.Phone.Controls.Toolkit.dll.

The list picker is displayed in the xaml design view and the code is:

xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
.
.
.
<StackPanel Grid.Row="0" Grid.RowSpan="3"  Orientation="Horizontal" >
        <toolkit:ListPicker x:Name="LP_Map" Width="284" Template="{StaticResource ListPicker_ChooseCountry_CreateGame_test}" BorderBrush="#FF884900">
            <i:Interaction.Triggers>
                <i:EventTrigger EventName="SelectionChanged">
                    <cmd:EventToCommand Command="{Binding ChangeMapCommand}" CommandParameter="{Binding ElementName=LP_Map}"/>
                </i:EventTrigger>
            </i:Interaction.Triggers>
            <toolkit:ListPickerItem Background="#FFAB7D33" Content="Europe1328WithWater" Foreground="Black" Style="{StaticResource ListPickerItem_CreateGame_ChooseCountry_test}" />
        </toolkit:ListPicker>

        <toolkit:ListPicker x:Name="Player_LP" Width="150" SelectionChanged="SelChangedCommand" BorderBrush="#FF884900" Foreground="Black">
            <toolkit:ListPickerItem Background="#FFAB7D33" Content="2 Players" Foreground="Black" FontFamily="Andalus" />
            <toolkit:ListPickerItem Background="#FFAB7D33" Content="3 Players" FontFamily="Andalus" />
            <toolkit:ListPickerItem Background="#FFAB7D33" Content="4 Players" FontFamily="Andalus" />
        </toolkit:ListPicker>
    </StackPanel>

I do not understand why I get an XAML parse error, is there something I need to update explicitly or change after the re-targeting of the solution?

Note EventToCommand using MVVMLight is not the issue, this has been updated to use the parameter package.

1

There are 1 best solutions below

0
EvZ On BEST ANSWER

ComboBox is not available in Windows Phone 8.1 Silverlight.

I'm working on WP8.1 Silverlight solution currently, using the latest version of WP phonetoolkit. Have no problem using ListPicker. Here is example:

xmlns:Local="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"

<toolkit:ListPicker
                    x:Name="MyListBox"
                    BorderBrush="{StaticResource AppBackground}"
                    Foreground="{StaticResource AppTextColor}"
                    ItemsSource="{Binding Categories}">
                    <Local:Interaction.Triggers>
                        <Local:EventTrigger EventName="SelectionChanged">
                            <Local:InvokeCommandAction Command="{Binding DataContext.OpenCategoryCMD, ElementName=LayoutRoot}"
                                                   CommandParameter="{Binding ElementName=MyListBox, Path=SelectedIndex}"/>
                        </Local:EventTrigger>
                    </Local:Interaction.Triggers>
                </toolkit:ListPicker>

And in ViewModel:

private void OpenCategory(int categoryIndex) { ... }