Search code examples
xamarin.formsbindingpicker

Picker list updated back-end but not front-end in xamarin forms


I'm trying to update the list that is bound to a picker in xamarin forms. After I changed the content, the property is correctly set but it is not updated visually.

   public List<string> Types
        {
            get { return _types; }
            set
            {
                SetProperty(ref _types, value);
            }
        }

   pckTypes = new Picker() { ItemsSource = Model.Types, Title = "--Choose a type" };

Solution

  • This worked for me and solved my problem:

    ObservableCollection<TypeEvent> _dataList = await service.GetAllTypesAsync();   
    foreach (var item in _dataList) 
    { 
       Types.Add(item); 
    }