我绕过ObservableCollection -> datatabel -> XML File
。
还可以加载XML file -> Datatabel -> ListView
。
但是ListView
也在应用程序的另一个页面中使用,所以我需要它再次绑定到ObservableCollection
。
我没有找到类似问题的运气,这个解决方案对我有用。 (DataTable to observable collection)。
好的,所以我一直在研究XML Serialize
和XML Deserialize
。 (按照以下方式:What is the easiest way to save an Observable collectin of object to an XML file?)
它保存到一个如下所示的文件中:
<?xml version="1.0" encoding="utf-8"?>
<ArrayOfSong xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
当我尝试加载它时,Listview不会刷新。我缺少什么?
答案 0 :(得分:0)
What is the easiest way to save an Observable collectin of object to an XML file?
使我的整个集合公开,并且XML序列化等解决了它。