@Ashiq's suggestion was correct. You need to set ItemsSource for the ComboBox.
I made a code sample for your reference:
<Page.DataContext>
<local:ViewModel></local:ViewModel>
</Page.DataContext>
<Grid>
<ComboBox ItemsSource="{Binding source}" SelectedValue="{Binding TipoDoc, Mode=TwoWay}"/>
</Grid>
public class ViewModel : INotifyPropertyChanged
{
private string tipodoc;
public string TipoDoc
{
get => tipodoc;
set
{
tipodoc = value;
RaisePropertyChanged("TipoDoc");
}
}
public ObservableCollection<string> source { get; set; }
public ViewModel()
{
source = new ObservableCollection<string>();
source.Add("item1");
source.Add("item2");
}
public event PropertyChangedEventHandler PropertyChanged;
private void RaisePropertyChanged(string PropertyName)
{
if (PropertyChanged!= null)
{
PropertyChanged(this,new PropertyChangedEventArgs(PropertyName));
}
}
}
Then, when you select one item, the TipoDoc
property value will be changed.
