Alguém poderia me auxiliar onde estou errando?
using System.Collections.Generic;
namespace testDrive.Models
{
public class ListagemVeiculo
{
public List<Veiculo> Veiculos { get; set; }
public ListagemVeiculo()
{
this.Veiculos = new List<Veiculo>()
{
new Veiculo {Nome = "Azera V6", Valor = 60000},
new Veiculo {Nome = "Fiesta 2.0", Valor = 50000},
new Veiculo {Nome = "HB20 S", Valor = 40000}
};
}
}
}
public MainPage()
{
InitializeComponent();
this.Veiculos = new ListagemVeiculo().Veiculos;
this.BindingContext = this;
}
<ListView x:Name="listViewVieiculos" Margin="25" ItemTapped="listViewVieiculos_ItemTapped" ItemsSource="{Binding Veiculos}">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<ViewCell.View>
<StackLayout Orientation="Horizontal">
<Label Text="{Binding Nome}" FontSize="20" VerticalTextAlignment="Center" ></Label>
<Label Text=" - " FontSize="20" VerticalTextAlignment="Center"></Label>
<Label Text="{Binding PrecoFormatado}" FontAttributes="Bold" VerticalTextAlignment="Center"></Label>
</StackLayout>
</ViewCell.View>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>