Search code examples
windows-phone-7xamlsilverlight-toolkitxamlparseexceptionlistpicker

Microsoft.Phone.Controls.Toolkit ListPicker throws XamlParseException


After being advised that the native ComboBox was not the way to go I was told to look at the Silverlight Toolkit ListPicker. So I did and have got a problem.

I opened a new project and pulled a new ListPicker onto the MainPage. The ListPicker looks like:

<toolkit:ListPicker x:Name="Result">
    <toolkit:ListPickerItem Content="Win" />
    <toolkit:ListPickerItem Content="Place" />
    <toolkit:ListPickerItem Content="Lose" />
</toolkit:ListPicker>

When trying to run this I get an XamlParseException with InnerException of InvalidProgramException. All I did was drag the control on, and add some ListPickerItem. Removing the items still results in the error, removing the ListPicker control completely allows the page to be shown with no error.

I'm sure I've missed something, but any documentation I have read seems to point towards this markup being fine, including http://windowsphonegeek.com/articles/listpicker-for-wp7-in-depth

I can provide any other info required.


Solution

  • The problem was that the wrong dlls had been registered, i.e. 7 and not 7.1. I had to uninstall and reinstall to get it to update correctly and it worked.