Exemple #1
0
        private void SelectCity(SelectCitiesViewModel citySelected)
        {
            if (citySelected.IsSelected)
            {
                CitiesSelected.Remove(citySelected);
                foreach (var city in Cities)
                {
                    if (city == citySelected)
                    {
                        city.IsSelected = false;
                    }
                }
            }
            else
            {
                if (CitiesSelected.Count < 11)
                {
                    foreach (var city in Cities)
                    {
                        if (city == citySelected)
                        {
                            city.IsSelected = !city.IsSelected;
                        }
                    }

                    CitiesSelected.Insert(0, citySelected);
                }
            }
        }
Exemple #2
0
 public void RemoveCity(SelectCitiesViewModel citySelected)
 {
     CitiesSelected.Remove(citySelected);
     foreach (var city in Cities)
     {
         if (city == citySelected)
         {
             city.IsSelected = false;
         }
     }
 }