private void ratingSort() { var toList = Grid_Detailes.Children.OfType <NannyDetailes>(); Grid_Detailes.Children.RemoveRange(1, toList.Count()); Number_of_nannies.ClearValue(TextBlock.TextProperty); if (Selected.Count != 0) { Number_of_nannies.Text += String.Format("We Find " + Selected.Count + " Nannies suit for you"); Selected = BLSorting.GetInstance().sortByRating(Selected); foreach (Nanny item in Selected) { Grid_Detailes.Children.Add(Element_of_Nanny_Detailes.AddNannyDetailesGrid(item)); } } else { Number_of_nannies.Text += String.Format("Sorry, but there no Nannies suit for you"); } }
private void distanceSort() { var toList = Grid_Detailes.Children.OfType <NannyDetailes>(); Grid_Detailes.Children.RemoveRange(1, toList.Count()); Number_of_nannies.ClearValue(TextBlock.TextProperty); if (Selected.Count != 0) { Number_of_nannies.Text += String.Format("We Find " + Selected.Count + " Nannies suit for you"); List <KeyValuePair <Nanny, int> > t = BLSorting.GetInstance().sortByDistance(Selected, tofunctions); for (int i = 0; i < t.Count; i++) { Grid_Detailes.Children.Add(Element_of_Nanny_Detailes.AddNannyDetailesGrid(t[i].Key)); } } else { Number_of_nannies.Text += String.Format("Sorry, but there no Nannies suit for you"); } }