Summary sometimes youll need to use components or

Info icon This preview shows pages 751–754. Sign up to view the full content.

View Full Document Right Arrow Icon
Summary Sometimes you’ll need to use components or APIs that were not designed with .NET in mind. You can use COM components and Win32 DLLs from C# thanks to the .NET Framework’s interop services. Visual Studio provides additional support specific to ActiveX controls, making it easy to incorporate these into Windows Forms applica- tions. The world of unmanaged code sometimes requires us to work directly with raw memory in an unsafe fashion, and to enable this, C# offers C-style pointers. We strongly discourage you from using them for anything other than interop. Summary | 727
Image of page 751

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

View Full Document Right Arrow Icon
Image of page 752
CHAPTER 20 WPF and Silverlight WPF and Silverlight are related technologies for building user interfaces in .NET. Al- though they are aimed at two significantly different scenarios, they share so many con- cepts and features that it makes sense to discuss both of them at the same time—almost everything in this chapter applies to both WPF and Silverlight. As its name suggests, the Windows Presentation Foundation (WPF) is for building interactive applications that run on Windows. WPF applications typically run as stand- alone applications, requiring an installation step to get them onto the target machine, as they may need prerequisites to be installed first. (WPF is .NET-based, so it requires the .NET Framework to be installed.) This means they are deployed like old-school Windows desktop applications. However, WPF makes it easy for applications to ex- ploit the graphical potential of modern computers in a way that is extremely hard to achieve with more traditional Windows UI technologies. WPF applications don’t have to look old-school. Silverlight is for web applications, or more specifically, so-called Rich Internet Appli- cations (RIAs). It does not depend on the full .NET Framework—it is a browser plug- in that provides a self-contained, lightweight, cross-platform version of the framework. The whole Silverlight runtime is around a 5 MB download, whereas the full .NET Framework is far more than 200 MB * —and Silverlight installs in seconds rather than minutes. Once the plug-in is installed, Silverlight content downloads as part of a web page, just like AJAX and Flash content, with no installation step for new applications. (Like with Flash-based Adobe AIR applications, it’s also possible for a Silverlight ap- plication to run out-of-browser once it has been downloaded, if the user consents.) But because Silverlight contains a form of the .NET Framework, you get to write client-side code in C#, which can run in all of the popular web browsers, on both Windows and Mac OS X. * It’s not usually necessary to download the entire .NET Framework—an online installer can determine which bits are required for the target machine. Even so, a full Silverlight download ends up being about one-fifth the size of the smallest possible download required for the full framework.
Image of page 753

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

View Full Document Right Arrow Icon
Image of page 754
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