Xamarin Forms Live Switch in CollectionView

Stewart Basterash 96 Reputation points
2021-03-10T16:20:53.253+00:00

I am trying to create a list (collectionview) of items that is a dynamic list. The user can create custom objects, but can enable or disable the option as desired... I am using an MVVM pattern and would like a "swtich" to simplify and minimize navigation... simply having an "on/off" switch in the list is what I am looking for... The current Switch component does not have a "command" and "commandparameter" so, I have attempted using Behaviors to solve this problem... No joy!

The issue I am having is updating the dataset for the list... If I had the command and command parameter I could update the data as necessary, then when a user navigates away and back the list will display the last changes (enable or disable)... As it is now, the changed values are not persisting the construction/destruction of the viewmodel when navigation occurs. I could rethink the entire application architecture, but this seems like throwing the baby out with the bath water.
76365-app.png

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,314 questions
0 comments No comments
{count} votes

0 additional answers

Sort by: Most helpful