将 Silverlight 应用程序移植到 Flex
也许是一个愚蠢的问题,但如果您使用 .NET(例如 Silverlight)C# 编写一个相对简单的 2D 游戏,并且您想将其移植到 Flex 中 - 只是因为您知道C# 并且不想打扰其他语言,有什么方法可以促进此移植过程吗?
假设我们正在使用CompositionTarget.Rendering 事件
来使用基于框架的开发(Flash 就是这样,与Silverlight 中的TimeLine 相反)。
我提出这个问题是因为我想尝试在 .NET 中创建一个功能齐全的应用程序,然后将其移植到 Flex
。
Perhaps a dumb question, but if you write a relative simple 2D game in .NET
(e.g. for Silverlight) C# and you want to port it to Flex
- just because you know C# and don't want to bother with other language, are there any means to facilitate this porting process?
Let's suppose that we are using FRAME BASED development (as Flash is, opposed to TimeLine in Silverlight) using the CompositionTarget.Rendering event
.
I pose this question because I would like to try to create a fully functional app in .NET and then port it to Flex
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不,不幸的是,没有直接的方法可以做到这一点。这是不幸的,因为 Silverlight 和 Flex 彼此非常相似。几乎每个平台中的每个功能都与另一个平台中的类似...但是两个平台中的语言(AS3 与 C#)和 UI 声明(MXML 与 XAML)是不同的。
您可以考虑将 MVVM 用于大部分行为逻辑以及一些良好的单元测试。将单元测试移植到 AS3,并使用 Flex 中的“演示模型”让您的 MVVM 代码运行起来。然后,使用暴力转换 UI。
一些可帮助您继续前进的资源:
祝你好运,并确保在博客中介绍您在执行此操作时学到的知识。我非常有兴趣看到有人这样做。
No, there is no direct way to do this, unfortunately. This is unfortunate, because Silverlight and Flex are so insanely similar to each other. Pretty much every feature in either has an analog in the other... but the language (AS3 vs C#) and the UI declaration (MXML vs XAML) is different in both platforms.
You can consider using MVVM for the majority of your behavior logic along with some good unit tests. Port the unit tests over to AS3 and get your MVVM code rocking using "Presentation Model" in Flex. Then, convert the UI using brute force.
Some resources to get you moving forward:
Good luck, and make sure to blog about what you've learned about doing this. I am VERY interested to see someone do it.
我还没有看到任何这方面的东西。这些语言/平台没有任何共同点,因此任何转换器基本上都是暴力破解。除非有人花时间创建转换器(对此表示怀疑),否则您将必须手动完成。
当然,这只是一个表示层。您可以想象将所有逻辑构建为服务,并在 Flex 演示文稿的基础上使用 .net 引擎,就像任何依赖于单独服务层的 Flex 或 silverlight 应用程序一样。
I've not seen anything for this. The languages/platforms feature nothing in common so any converter would basically be brute force. Unless someone has taken the time to create a converter (doubt it), you're going to have to do it manually.
Of course, that's just a presentation tier. You could conceivably build all the logic as services and have a .net engine underlying the Flex presentation like you would any flex or silverlight app that relied on a separate service tier.