how do i add a photo from a gallery to a collectionview project?

first, keep a reference to your VM

    VM ViewModel;

    public MainPage()
    {
        InitializeComponent();
        BindingContext = ViewModel = new VM();
    }

then, when you add the picture, do NOT create a new VM instance

var page = new VM();
page.Types.Add(image);

instead, use the instance of the VM your page is already bound to

ViewModel.Types.Add(image);

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top