is that I have a ComboBox in XAML and I have to do Binding to the ViewModel to load it with a query that I do of a table called "City" that has some fields id, Name, Country. but in the combo I'm only interested in showing the city, I think it goes like this but I do not know what I'm doing wrong, if I do the query the list is loaded, but not the Combo.
Combo Code:
<ComboBox Header="Ciudad" Width="245" ItemsSource="{x:Bind Ciudades}" SelectedIndex="{Binding CountCiudad, Mode=TwoWay}">
<ComboBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Nombre}"/>
</StackPanel>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
The properties that I have are like this:
public List<Ciudad> Ciudades { get => ciudades; set => Set(ref ciudades, value); }
private List<Ciudad> ciudades;
and so I have the method:
public async void CargarCiudades(){
this.Ciudades = new List<Ciudad>(await App.Repository.Ciudad.GetAsync());
}
I do not know why it does not load me, in the method the list is loaded, so I do not know if it's in the XAML where I'm failing
Image of the behavior of the method