Hi,@Eduardo Gomez . You could refer to the code as follows.
private async void GetAirportList()
{
var temppList = await Services.GetAirportsAsync();
//var tempObservable = new ObservableCollection<Airport>();
var tempObservable1 = new ObservableCollection<Airport>();
//foreach (var item in temppList!)
//{
// if (!tempObservable.Contains(item))
// {
// tempObservable.Add(item);
// }
//}
var newItems = temppList.Where(x => !tempObservable1.Any(y => x.city == y.city));
foreach (var item in newItems!)
{
if (!tempObservable1.Contains(item))
{
tempObservable1.Add(item);
}
}
//AirportsList = tempObservable;
AirportsList = tempObservable1;
}
The result:
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.