I tried in either of the ways to bind 2 list views using MVVVM but, couldn't able to do that. While I'm calling 2 property with same API with 2 different models, it is asking me to call await function. But I want both the property to fetch API at a time.
namespace Grading.ViewModel
{
public class GradingViewModel
{
private ObservableCollection<GradingModel> items;
public ObservableCollection<GradingModel> Items
{
get { return items; }
set
{
items = value;
}
}
public GradingViewModel()
{
Items = new ObservableCollection<GradingModel>()
{
};
MyHTTP.GetAllNewsAsync(list =>
{
foreach (GradingModel item in list)
items.Add(item);
});
}
public Details()
{
Items = new ObservableCollection<Details>()
{
};
MyHTTP.GetAllNewsAsync(list =>
{
foreach (Details info in list)
Info.Add(info);
});
}
}
}
Itemsbe setted twice at a time maybe not a good logic. You can show more info about project. - Junior Jiang