729 at the time of this writing microsoft does not

Info icon This preview shows pages 753–755. Sign up to view the full content.

View Full Document Right Arrow Icon
729
Image of page 753

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
At the time of this writing, Microsoft does not produce a Silverlight plug- in for Linux. However, an open source project called Moonlight offers a Linux-compatible version of Silverlight. This is based on the Mono project, an open source version of C# and the .NET Framework that can run on various non-Microsoft systems, including Linux. Microsoft has provided some assistance to the Moonlight project to help its developers achieve compatibility with the Microsoft Silverlight plug- in. However, be aware that the Moonlight plug-in has historically lagged behind Microsoft’s—as we write this, Moonlight’s current official re- lease is two major version numbers behind Microsoft’s. If you need to support Linux desktop machines with a Silverlight-based web applica- tion, this lag will limit the features you can use. Despite the very different environments in which WPF and Silverlight applications run, they have a great deal in common. Both use a markup language called Xaml to define the layout and structure of user interfaces. Their APIs are sufficiently similar that it is possible to write a single codebase that can be compiled for either WPF or Silverlight. There are critical concepts, such as data binding and templating, which you need to understand to be productive in either system. It’s not accurate to say that Silverlight is a subset of WPF. However, this doesn’t stop people from saying it; even Microsoft sometimes makes this claim. It’s strictly untrue: WPF has many features that Silverlight does not and Silverlight has a few features that WPF does not, so neither is a subset of the other. But even if you allow a slightly woolly interpretation of the word subset , it’s a misleading way to describe it. Even where both Silverlight and WPF offer equivalent features they don’t always work in the same way. A few minutes with a decompilation tool such as Reflector or ILDASM makes it abun- dantly clear that WPF and Silverlight are quite different beasts on the inside. So if you are contemplating building a single application that works both in the browser as a Silverlight application and on the desktop as a WPF application, it’s important to un- derstand the point in the following warning. While it is possible to write a single codebase that can run as both WPF and Silverlight code, this doesn’t happen automatically. Silverlight code is likely to need some modification before it will run correctly in WPF. If you have existing WPF code, significant chunks of it may need re- writing before it will run in Silverlight. Codebases that run on both WPF and Silverlight tend to use conditional compilation— they use the C# preprocessor’s #if , #else , and #endif directives to incorporate two different versions of the code in a single source file in the places where differences are required. Consequently, development and testing must be performed on Silverlight and WPF side by side throughout the development process.
Image of page 754
Image of page 755
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern