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.
Comments: Closing fixed issues.
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.
Comments: Closing fixed issues.