【问题标题】:XML file -> Datatabel -> ObservableCollection [closed]XML文件->数据表-> ObservableCollection [关闭]
【发布时间】:2013-10-28 22:56:03
【问题描述】:

我得到了相反的ObservableCollection -> datatabel -> XML File。

也可以加载XML file -> Datatabel -> ListView。

但是ListView也在应用的另一个Page中使用,所以我需要再次绑定到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 不会刷新。有什么我想念的吗?

【问题讨论】:

  • 如果您需要任何代码,请说出来。

标签: c# xml wpf listview observablecollection


【解决方案1】:

What is the easiest way to save an Observable collectin of object to an XML file?

公开我的整个集合,以及 XML 序列化等。解决了它。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-07-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多