A while ago we faced a task of converting Silverlight front-end application into HTML5. Apart from the fact that app was 100% based on Silverlight 5, it used third-party components like Telerik, KML files read/write utilities, Spatial data processing utilities, MS Map Controls, PRISM (MS pattern & practices library) as well as data archiving component.
Quite a mess, right?
Solution itself had around 200 XAML files and around 1200 .cs files: code-behind, models and business logic. Application was built using the MVVM architecture that is pretty much a standard for Silverlight.
As we were digging deeper into the problem we found out that there are currently no 100% automated conversion tools on the market that will do the job. However, there are some tools which could absorb XAML files and convert them to SVG (HTML5 vector graphics format). Sounds like a plan, right?!
So we started:
- Adobe Illustrator CS5 HTML5 Pack
- Opensource Inkscape Editor
- Open source Fayde Engine
But, unfortunately, we failed… The resulting files were totally unacceptable. All those tools can deal with the limited number of XAML tags and at the same time ignoring all tags from custom namespaces.
Thus we had to assume that the client application has to be rewritten from scratch stating that:
- there is no way to use XAML design
- some components don’t have HTML5 alternatives and needed to be replaced
- server-side processing needed to be re-implemented as a web service
In such scenario, porting the project from Silverlight to WPF can be an option since WPF is a more mature technology. This approach can also save effort for up to 4 times.
There are some tools (e.g. C#/XAML for HTML5), which should go to market soon, so legacy code can be reused more effectively though.