Eeshan
Eeshan

Reputation: 23

Binding issues with toolkit:MultiselectList Windows Phone 8

So I have been working on a windows phone 8 app and I have some issues with Binding data to toolkit:MultiselectList. The XAML I have is

<toolkit:MultiselectList x:Name="CatCardList">
    <toolkit:MultiselectList.ItemTemplate>
        <DataTemplate>
            <StackPanel Tap="ListItemTap" Orientation="Horizontal" Height="120">
                <Rectangle Height="100" Width="100" Fill="{Binding accent}"/>
                <StackPanel>
                    <TextBlock Text="{Binding name}"/>
                    <TextBlock Text="{Binding limit}"/>
                    <TextBlock Text="{Binding alert}"/>
                </StackPanel>
            </StackPanel>
        </DataTemplate>
    </toolkit:MultiselectList.ItemTemplate>
</toolkit:MultiselectList>

I am inserting elements of a class which has the following elements (all public with appropriate get and set)

string name
string limit
string alert
SolidColorBrush accent

When the element is inserted I am only seeing the ToString() of that class in the list because the binding is not applied. If on the other hand I use the ListBox control with the same binding then everything works fine.

Another interesting fact is that when I had NuGet 2.0, the above binding worked fine. But I updated the NuGet package today and since then it has stopped working and I get an Invalid XAML warning, but it compiles fine.

I have no idea why this is not working when it used to work before. Can someone please tell me as to whether this is a bug with the NuGet package or is there something wrong with my code?

Thanks.

Upvotes: 2

Views: 1415

Answers (2)

Wilder
Wilder

Reputation: 41

This is because the WindowsPhone 8 project of Phone toolkit doesn't include style defintion for MultiselectList, copy the style defintion with TargetType"controls:MultiselectList" from WindowsPhone 7 project to Themes/Generic.xaml should work.

Upvotes: 0

fattikus
fattikus

Reputation: 542

I had the same problems, I fixed those problems by using the new Long List multi selector control available on the windows phone 8 sdk...

It should fix all your problems!

Upvotes: 2

Related Questions