你正在走正确的道路。请访问 Martin Fowler 的网站,查看演示模型的模式。
基本想法是构建一个UI模型(ViewModel),并使UI与其同步。 要在UI中显示的每一位信息都应该在ViewModel中有一个相应的字段或属性(尽管它们可以从Model中的价值被检索或派生)... ViewModel使得存储视图状态/会话状态变得容易(例如用户列表中当前选择的项目),而这在Model类后面不存在。
Since you want to show the elapsed time since value in the UI, your ViewModel should have a property caled ElapsedTimeSince. Your WPF View has a control which is data-bound to this property.
Now as per your need, ensure you have a thread/timer event that re-evaluates the property value periodically using the current time and the Model s StartDate property. Your UI should reflect the updated value.