public ListadoDeLugares() { string databasePath = DependencyService.Get <IFileHelper> ().DatabasePath("database.db"); viewModel = new LugarViewModel(databasePath); var template = new DataTemplate(typeof(TextCell)); template.SetBinding(TextCell.TextProperty, "Title"); template.SetBinding(TextCell.DetailProperty, "Address"); template.SetValue(TextCell.TextColorProperty, Color.Green); list.ItemTemplate = template; list.ItemsSource = viewModel.Lugares(); list.ItemTapped += List_ItemTapped; //Global page Title = "Listado"; Content = list; }
protected override void OnAppearing() { base.OnAppearing(); list.ItemsSource = viewModel.Lugares(); }