【发布时间】:2015-11-05 06:55:07
【问题描述】:
我需要将 DateTimeOffset 属性绑定到 WPF DatePicker,因为 Odata 不支持 DateTime。
我知道如何绑定DateTime 属性。
我尝试将DateTimeOffset 属性绑定到DatePicker,就像绑定DateTime 属性一样。
但价值根本没有改变。它始终具有默认值。
我该如何解决这个问题?
【问题讨论】:
-
使用
DataTimeOffset.DateTime属性转换为DateTime。正如您已经知道如何绑定它,可能比弄清楚如何绑定DateTimeOffset更快。 -
感谢 Jack,保存记录时可以使用。但是我在检索记录时遇到了错误。 “TwoWay 或 OneWayToSource 绑定无法在“System.DateTimeOffset”类型的只读属性“DateTime”上工作。”。你有什么想法吗?
标签: c# wpf mvvm datepicker caliburn.micro