コード例 #1
0
        public Lugares()
        {
            var databasePath = DependencyService.Get <IFileHelper> ().GetLocalFilePath("database.db3");

            //Inicializa el view model
            viewModel = new PlaceViewModel(databasePath);


            list             = new ListView();
            list.ItemsSource = viewModel.Get();

            //Definiendo el estilo
            var template = new DataTemplate(typeof(ImageCell));

            template.SetBinding(TextCell.TextProperty, "Name");
            template.SetBinding(TextCell.DetailProperty, "FormatedAddress");
            list.ItemTemplate = template;
            Content           = list;

            list.ItemTapped += List_ItemTapped;

            Title = "Lugares";
        }
コード例 #2
0
 protected override void OnAppearing()
 {
     base.OnAppearing();
     list.ItemsSource = viewModel.Get();
 }