我正在开发一个适用于 Windows Phone 7 的应用程序。我想让我的应用程序可持久化,以便我可以在重新启动后恢复我的应用程序。
但问题是我有一些 func<>委托成员动态地指向我想要保留的某些类对象中的某些函数。
Actually I am serializing my func<> delegate member using [datamember] attribute
and deserializeing it to persist state.
而且我不知道它们在Wp7中是否可以持久。
我知道它在WPF中是可持久的。我读了几篇文章,似乎它在WP7中不可持久。
func<> 的替代方案是什么?如果它在 WP7 中不可持久。
I am developing an application for windows phone 7.I want to make my application persist-able so that I can restore my application after restart.
but the problem is that I have some func<> delegates members which are ,dynamically pointing to some functions ,in some of Class objects which I want to persist.
Actually I am serializing my func<> delegate member using [datamember] attribute
and deserializeing it to persist state.
And I don not know whether they are persist-able or not in Wp7.
I know that it is persist-able in WPF.I read few articles and it seems it is not persist-able in WP7.
And What is an alternative for func<> if it is not persist-able in WP7.
发布评论
评论(1)
您可以序列化委托,但这有点冒险,因为只保存编译器生成的名称。
查看此示例
You can serialize the delegates, but it is a bit risky cause only the compiler generated name is saved.
Look at this example