序列化样式 - 或从样式中读取值 [英] Serialize Style - or read values from style

查看:63
本文介绍了序列化样式 - 或从样式中读取值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好



在我的应用程序中,我有一个网格,我的用户可以在运行时为行选择字体,颜色和其他一些设置。使用选定的颜色,字体和其他值,我在代码隐藏中创建了一个新样式。然后我设置我在网格上设置的这种样式。 - >这很完美。但是:



现在我喜欢在我关闭应用程序的情况下保存这种风格。重新启动后我喜欢这样再次设置相同的样式。如何访问该样式的单个元素来序列化它。





谢谢

Hello

In my application I have a grid where my users can select the font, color and some other settings at runtime for the rows. With the selected color, font, and others values I create a new style in the codebehind. Then I set this style I set on the grid. --> This works perfect. But:

Now I like to save that style in the case I shutdown my application. After a restart I like so set the same style again. How can I access of the single elements of that style to serialize it.


Thanks

推荐答案

只要您将设置保存在某个位置(如配置文件(或数据库表)),在应用程序启动时,您应该能够检查文件并运行当前进行更改的相同代码。它会在没有用户表达方向的情况下发生。
As long as you save the settings somewhere like a configuration file (or database table), on app start up you should be able to check the file and run the same code that currently makes the changes. it will just happen without the users express direction.


这篇关于序列化样式 - 或从样式中读取值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆