I have a collection view with a Share option in the items, it is working as expected. However, it is refreshing the page by calling OnAppearing event again. This is causing the collection view with so many items to refresh and lose the state.
await Share.RequestAsync(new ShareTextRequest
{
Text = message,
Title = title
});
You could bind ViewModel for
ItemsSource
of CollectionView, and the ViewModel and Model inherit fromINotifyPropertyChanged
. Then when property of ViewModel changed, it will interacte with UI.For example:
Now when property changed, it will update the data of ViewModel. You will not need to call
OnAppearing
method.Refer to Interactive MVVM.