Winforms(后来的 WPF)应用程序状态持久化
我有一个 winforms 应用程序,目前我混合使用标准控件和 Syncfusion 控件。大约几个月后,将在 WPF 中开发新模块。
我想添加一些状态保存功能。你知道。 TreeView x 的最后一个打开节点是 y。分离器 X 被分离到 Y 点,依此类推。
我见过一些方法。我已经了解了如何使用内置应用程序设置以及如何将其绑定到 winforms 和 WPF。当您的应用程序是模块化的或动态创建 GUI 时,这会出现问题。
我想到了几种方法。我有点喜欢一种反映实体框架 POCO 方法的方法。我真的不想用属性来装饰我的 GUI 代码,或者从了解 gui 持久性的特殊基类派生它,或者实现 ISerialized 等。
话虽如此,我也在考虑使用属性来装饰 gui 组件,有点重复框架中可序列化代码已经做的很多事情,但专门针对 GUI 设置。我也考虑过只使用可序列化的东西,但它并不能准确地反映我的意图。
有人对此有什么建议吗?
谢谢
I have a winforms app, I use a mix of standard controls and Syncfusion controls currently. In a few months or so new modules will be developed in WPF.
I'd like to add some state saving functionality. You know. TreeView x's last open node was y. Splitter X was split to point Y and so forth.
I've seen a few approaches. I've seen using the built in application settings and how to bind that to winforms and WPF. This has issues when your application is modular or the GUI is dynamically created.
I've got a few approaches in mind. I'd sort of like an approach which mirrors Entity frameworks POCO approach. I don't really want to be decorating my GUI code with attributes or deriving it from a special base class that knows about gui persistence, or implementing ISerializable, etc.
Saying that, I'm also considering using attributes to decorate the gui components and sort of duplicating a lot of what the serializable code in the framework already does, but specifically geared towards GUI settings. I also considered just using the serializable stuff, but it doesn't reflect my intent accurately.
Does anyone have any advice they can give on this?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论