Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

ObservableCollection in Picker don't refresh on UWP.

$
0
0

Hello,

I'm using Xamarin.Forms v2.3.4.184-pre1 and I tried to create a Picker.
The picker works fine, binding is ok and when i add some objects to my ObservableCollection, the picker is automatically updated on Android but not seems to update in UWP. (I use the Mobile Emulator 10.0.14393.0).

I don't have tested on iOS.

XAML:

<Picker Title="Capacity"
                    ItemsSource="{Binding Capacities, Mode=TwoWay}"
                    ItemDisplayBinding="{Binding Name}"/>

Code behind (View model):
`
private ObservableCollection _capacities;

    public ObservableCollection<Capacity> Capacities
    {
        get { return _capacities; }
    }

`

Add capacity:

_capacities.Add(capacity);
RaisePropertyChanged("Capacities");

**My model: **
`public class Capacity
{
public int Id { get; set; }

    public string Name { get; set; }
}`

It is a bug in the Xamarin.Forms pre-release ?


Viewing all articles
Browse latest Browse all 77050


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>