How to refresh the data in pivot item after updating data through xaml UI?

蹲街弑〆低调 提交于 2019-12-02 01:58:44

I have done, first of all no need to refresh the page, observable collection can do it automatically. my observableCollection is saveInfoCollection.

there are three possiblities with the observable collection

1) deletion a item from observable collection.

2) Modifying a item in observable collection.

3) Add a item in observable collection.

Explaination

1) In first case when i will delete the item from the observable collection i will use the remove method of the observable collection like following

//savedData is my observableCollection name.
savedData.Remove(selected);

2) In second case when i will modify the item from the observable collection, here you will see the magic of the observable collection, I am taking the item object with the help of Tag property, so as i will update my database it my observable collection will automatically update.

3) In this case you can add new data object into the observable collection, and it will automatically update the observable collection.

If you are using the observableCollection than no need to refresh the page. It is the magic of ViewModel.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!