简体   繁体   English

将Silverlight应用程序移植到Flex

[英]Porting Silverlight app to Flex

Perhaps a dumb question, but if you write a relative simple 2D game in .NET (eg 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? 也许这是一个愚蠢的问题,但是如果您在.NET编写相对简单的2D游戏(例如,对于Silverlight),并且想将其移植到Flex -只是因为您知道C#,并且不想打扰其他语言,有什么方法可以促进这一移植过程?

Let's suppose that we are using FRAME BASED development (as Flash is, opposed to TimeLine in Silverlight) using the CompositionTarget.Rendering event . 假设我们正在使用CompositionTarget.Rendering event使用基于FRAME的开发 (因为Flash与Silverlight中的TimeLine相对)。

I pose this question because I would like to try to create a fully functional app in .NET and then port it to Flex . 我提出这个问题是因为我想尝试在.NET中创建功能齐全的应用程序,然后将其移植到Flex

No, there is no direct way to do this, unfortunately. 不,不幸的是,没有直接的方法可以做到这一点。 This is unfortunate, because Silverlight and Flex are so insanely similar to each other. 这是不幸的,因为Silverlight和Flex如此疯狂地相似。 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. 几乎每个功能中的每个功能都具有相似的功能...但是,两种平台的语言(AS3与C#)和UI声明(MXML与XAML)是不同的。

You can consider using MVVM for the majority of your behavior logic along with some good unit tests. 您可以考虑将MVVM用于大多数行为逻辑以及一些良好的单元测试。 Port the unit tests over to AS3 and get your MVVM code rocking using "Presentation Model" in Flex. 将单元测试移植到AS3,并使用Flex中的“演示模型”来获取MVVM代码。 Then, convert the UI using brute force. 然后,使用蛮力转换UI。

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. 我非常有兴趣看到有人这样做。

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. 可以想象,您可以将所有逻辑构建为服务,并在Flex演示文稿的基础上使用.net引擎,就像依赖单独服务层的任何flex或silverlight应用程序一样。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM