arvind baldaniya

arvind baldaniya

  • NA
  • 339
  • 141.3k

Adding Dropdown with Dynamic data [Picker] Also Getting data

Mar 17 2017 11:23 AM

MVVM And Xamarin  

My Code
XAML File

ViewModel File

List m_city = new List();
public List get_Cities { get; set; }
public void GetCity()
{
m_city = Database.DB.All().ToList();
var city_names = m_city.Select(x => new { x.Id , x.Name}).Distinct().ToList();
foreach (var item in city_names)
{
City get_City = new Models.City();
get_City.Id = item.Id;
get_City.Name = item.Name;
get_Cities.Add(get_City);
}
}


Answers (2)