Closed
Description
Discussed in #7528
Originally posted by XamerDev May 27, 2022
Hello I need to create grouped collectionView but I'm facing some issues on Windows. On android works well
Code
public class FoodGroup : ObservableCollection<Food>
{
public string Name { get; private set; }
public FoodGroup(string name, ObservableCollection<Food> foods) : base(foods)
{
Name = name;
}
}
public ObservableCollection<FoodGroup> Lines { get; private set; } = new ObservableCollection<FoodGroup>();
and when I trying add something to Lines collection:
Lines.Add(new FoodGroup("group1", new ObservableCollection<Food> { }));
I facing this issue:
"MauiApp3.ViewModels.JournalViewModel+FoodGroup" is not of type "MauiApp3.Models.Food" and cannot be used in this generic collection. Arg_ParamName_Name”
Issue appears only on Windows, on android emulator everything is working properly.
Is it something connecting with MAUI itself or it's just my misunderstanding of something?
Thank you