1

Closed

LongListSelector: Adding items to empty category creates a duplicate category

description

Hi,
 
I noticed that if you have an empty category, and you add items to it, it will create a duplicate category, add the items to that category, and leave the original empty category alone.
 
To repro this issue, just use the following setup:
 
        <controls:PivotItem Header="code">
            <toolkit:LongListSelector x:Name="codeMovies" Background="Transparent" DisplayAllGroups="True"
                ItemsSource="{StaticResource movies}"
                ListHeaderTemplate="{StaticResource movieListHeader}"
                GroupHeaderTemplate="{StaticResource movieGroupHeader}"
                GroupItemTemplate="{StaticResource groupItemHeader}"
                ItemTemplate="{StaticResource movieItemTemplate}">
 
    public MoviesByCategory()
    {
        List<string> sortedCategories = new List<string>(Movie.Categories);
        sortedCategories.Sort();
 
        foreach (string category in sortedCategories)
        {
            MoviesInCategory group = new MoviesInCategory(category);
            this.Add(group);
            /*
            for (int i = 0; i < 5; ++i)
            {
                group.Add(Movie.CreateRandom(category));
            } 
            */
        }
    }
 
    public void Execute(object parameter)
    {
        MoviesInCategory group = parameter as MoviesInCategory;
        if (group != null)
        {
            for (int i = 0; i < 5; i++)
            {
                group.Add(Movie.CreateRandom(group.Key));
            }
        }
    }
 
Thanks.
Closed Sep 5, 2012 at 11:37 PM by RohanTha
Closing fixed issues.

comments

drelyea wrote Nov 14, 2010 at 8:55 PM

This should be fixed with changelist 57505. I will be updating the installer and sources zip.