2
Answers

Adding Dropdown with Dynamic data [Picker] Also Getting data

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)