diff --git a/gehGassiApp/gehGassiApp/ViewModels/HomeViewModel.cs b/gehGassiApp/gehGassiApp/ViewModels/HomeViewModel.cs index 6077d4f..04be5ac 100644 --- a/gehGassiApp/gehGassiApp/ViewModels/HomeViewModel.cs +++ b/gehGassiApp/gehGassiApp/ViewModels/HomeViewModel.cs @@ -539,7 +539,12 @@ namespace gehGassiApp.ViewModels request.Distance = Location.CalculateDistance(CurrentLocation.Lat.Value, CurrentLocation.Lng.Value, request.Lat, request.Lng, DistanceUnits.Kilometers); } - Walkers = requests.Value.ToObservableCollection(); + // Sortierung: Entfernung, dann mit Foto, dann mit Rating + Walkers = requests.Value + .OrderBy(x => x.Distance) + .ThenByDescending(x => !string.IsNullOrWhiteSpace(x.Photo)) + .ThenByDescending(x => x.AverageRating > 0) + .ToObservableCollection(); _total = requests.Total; _skip = requests.Skip + requests.Take;