Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help with Bindings for ChipGroup #4464

Open
mcferdev opened this issue Aug 27, 2022 · 1 comment
Open

Help with Bindings for ChipGroup #4464

mcferdev opened this issue Aug 27, 2022 · 1 comment

Comments

@mcferdev
Copy link

Hi. I am a little bit lost.
I come from Xamarin.Forms, but now I have to do something with Xamarin Android (native) using mvvmcross.
Android has a ChipGroup that you put Chips, but I need to Bind this with a ObservableCollection in my viewmodel. When I have a ListView I can Bind the ItemsSource property and works, but ChipGroup doesn´t have a ItemsSource property, so I am a little bit lost.
I am trying to achive it doing some binding, but it´s not working. I don´t know if Mvvmcross has something to help.

@entdark
Copy link
Contributor

entdark commented Aug 29, 2022

You need to inherit from ChipGroup and create your own custom MvxChipGroup (name it however you what) and add there ItemsSource property of type IEnumerable. Handle all the logic inside your custom class.
Use MvxListView as a reference: https://github.com/MvvmCross/MvvmCross/blob/develop/MvvmCross/Platforms/Android/Binding/Views/MvxListView.cs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants