How Silverlight Works

Source: Internet
Author: User
Tags silverlight

how Silverlight works by how Silverlight interacts with the server-side managed code. Silverlight might be to download the managed DLL to local execution. This is true after tracing the HTTP request with the tool. 1. After IE loads the page. The HTML page, the Silverlight.js, and the XAP application package are loaded in the IE cache. clip_image002[7]2. FF Debug Network communication discovery. Load the HTML page first--Silverlight.js---get a linkid---XAP Application Package-install Silverlight pictures clip_image004-getting a LinkId is actually the picture below. PNG is also the picture clip_image006clip_image008 originally Silverlight by the name of the class library specified in XAML, download the appropriate. dll and. pdb files (they are combined together to be a XAP application package) to the client, Executes after the local environment is loaded. So, after downloading all the libraries, Silverlight works the same way as WinForm. For the same reason, the files compiled by the Silverlight project are placed in the ClientBin directory, which means that the files for this directory are to be downloaded to the client. Used to support Silverlight-enabled runs. So why has the application been downloaded? But you can still debug at the breakpoint. This is the same as the principle of ASP. The virtual directory for IIS points to the project directory in your vs. Debugging in VS is the processing of requests for IIS. Silverlight3.0JS code and background debugging relationship is the background code can be debugged, and JS is not debugging. It's because the following is what Silverlight debugging refers to vs why you can respond to JS debugging: Pre-debug settings you'll find. JS debugging must first set the browser's disabled debugging settings not selected. This proves that the debug of JS is actually run through vs. Can vs in debugging JS when the role and firebug the same. are debugged for the browser. And why someone said debugging JS, the backstage can not debug. JS debugging is for the browser. Background debugging is a request for IIS. So when they do, they are not in conflict. Before testing note: IE iifted with script debugging when Silverlight debugging is not selected. The XAML's background breakpoint is ignored. Both JS and backend code can be debugged. When you open Silverlight debugging, the VS debugger hint of the JS code is not available. Because he's driving a Silverlight for testing. So JS debugging and Silverlight conflict. CLIP_IMAGE010 structure: Clip_image012øsilverlight project file structure a standard Silverlight project typically consists of the following sections: ²web page: for embedding or hosting Silverlight-based applications. In theThe section contains two separate JavaScript files, each of which is used to create Silverlight and check whether the Silverlight plug-in is installed locally. A<div> contains Silverlight, which defines a style by <Style> in <Head>, and <div>inside is a line of simple JavaScript function calls to create Silverlight. This function is in a separate JavaScript file that was previously included. ²javascript file Silverlight.js: A file that assists in creating a Silverlight plug-in that defines Creatobject and Creatobjectex methods for creating Silverlight, Defines the Silverlight version check code and the code that instantiates the Silverlight plug-in. TestPage.HTML.js: Call the Creatsilverlight method in Silverlight.js to create the Silverlight plug-in. is responsible for extracting a XAML file using Silverlight-specific objects and converting this XAML into Silverlight. ²xaml file: A user interface element that defines a Silverlight application is like a Flash SWF file, but the SWF file includes both resources and logic, and is unreadable, and XAML includes only resources and representations, not program logic, and is readable. Each XAML file corresponds to one of the same file names+". CS"Or". vb"server-side code that is similar to ASPX's codebeside. ²silverlight plug-in: Used to output Silverlight content, which uses the HTML<Object> or <Embed>how tag embedding htmløsilverlight works A. HTTP requests are made from the browser, and the server returns HTML and JAVASCRIPTB when it is received. JavaScript first checks whether the Silverlight plug-in is installed, and if not, provides download C. JavaScript begins to create Silverlight and downloads XAML file D from the server. After the Silverlight JavaScript checks to the XAML file, requests the program logic to the server as needed (regardless of whether the background is CS source code or compiled, the program logic is always responsible for compiling and executing the background, and then passing the execution result through XML to the foreground). Because the content of the request and response is very short, it is similar to Ajax, so if the network bandwidth is sufficient, it should not be very card. E. Local JavaScript responds with response results after receiving a response note: The above is just created. If running, see how it works. Øsilverlight and ASP ./Ajax.NET We just mentioned that Silverlight integrates existing Web technologies, which also includes ASP. NET and ajax.net, so it can be designed to complement the relationship, and if you talk about Silverlight in depth to communicate with any Ajax program, Includes front-end and back-end (Client&Server side), so that ASP. NET and Ajax.NET can be used to control Silverlight as the base of the visual data, to show a rich user interface, for example, you can point in the Silverlight to another program, Or play a movie based on program requirements. Ø configuring Silverlight Server Deployment Silverlight to the product Web server is a fairly easy process, although there are sometimes illusions-for example, that Silverlight needs to be deployed on a Microsoft-based Web server (IIS). Silverlight does not force a certain deployment on Microsoft-based Web servers, and Apache can also easily and happily support Silverlight operations like IIS. Web servers typically only support static file content with a limited number of known extensions, and Silverlight introduces two new file extensions, so you need to add MIME types to the Web server so that the Web server can identify and process those types of files. Øsilverlight has different technical fundamentals with Adobe Flashsilverlight and flash: Flash uses the "semi-public" binary format and Silverlight is based on declarative programming in WPF. To clearly demonstrate the differences between Microsoft® and ® in Ria's presentation layer, language, and tool architecture, there are two architectural comparison charts as follows: Clip_image013silverlight full series –hello Word application If you have already configured your development environment, if not you can refer to the full range of Silverlight-start. Brief1. I'll be here with the same example in two development environments: Vs2008 and Microfot Expression Blend3. 2explains the file structure and composition of a typical Silverlight project. 3. Simply explain how a Silverlight project works. 4. Complete Hellowworld application. 5. MainPage.xaml and MailPage.xaml.cs relations. Microsft Expression Blend3: is a gorgeous visual development environment, mainly use it to do interface layout and artwork-related work, of course, its function is much more than this little bit. Start using vs2008 to build HelloWorld1. Open Vs2008 Create a new project: File >>Create a new project.2. In the New Project dialog box, select: C # >>Silverlight application. Name the project: Helloworldalt="Silverlightserial_hellowworld_createnewproject"title="Silverlightserial_hellowworld_createnewproject"v:shapes="_x0000_i1027">3Click OK, and you can see the following dialog: clip_image015 because Silverlight needs to run essentially in a plug-in environment, it needs a host to host it. This interface is asking if you need to build a Web application to host the Silverlight application at the same time. Of course if you are only developing Silverlight application independently then you can also not have to host the Silverlight applicationinchANew Web site before the tick is removed. If so, your Silverlight application will help you generate an HTML test page to host your Silverlight when you need to debug. program file structure If you click "OK" directly (OK) You will get the following display: clip_image016 Once you're done, you can solution the structure of the file inside that you created for you. It is necessary to make a simple introduction, and generally understand what the Silverlight development environment is all about. First you will see a HelloWorld project. This is a "Silverlight application" type of project. Silverlight cannot use the traditional. NET Framework platform's class library, which has its own development platform. In the Silverlight application project, you can see that I identified a, B. Where: A: It is necessary that when Silverlight is started it will be executed first. It is a specific app object that inherits from the application class, which mainly helps you to do the initialization of the application and start the application, that is, we know the "program Portal". B: By default, you'll see a mainpage.xaml and MainPage.xaml.cs file, which is inherited from the UserControl class. The app will load this interface by default. The application package must contain an assembly that has a class derived from application. The application class encapsulates the interaction between your application and the Silverlight plug-in. For example, it allows you to display the user interface within the host Web page. In addition, it provides application lifetime events and resource management. Then another project is located below the Silverlight application project. That's a traditional Web application project. Under this project I have identified C. C: is automatically generated and used to host Silverlight applications, you can set any one of them as the starting page. ClientBin: You can also see a ClientBin folder, and the Silverlight-generated download package (. xap) is saved here. Once you build the project you will see the HELLOWORLD.XAP package inside. The file structure is explained here. Program Operation Principle 1Once you have completed the Silverlight program, it generates a. xap package and puts the package into the ClientBin file. But in a complex situation, you can see not only the. xap package, but also some. zip files that are also compressed anyway here. These packages and the compressed package will be downloaded to the client. 2when a user requests a page that hosts Silverlight, such as a helloworldtest.aspx page, the package is first downloaded. 3once a package download is complete, the Silverlight runtime loads the Silverlight application into the application domain. 4The App.cs will then execute first, and it will load the MainPage.xaml and display it. Application domain: Perhaps a lot of people are not familiar with this concept, and you can temporarily think of it as a specific area to run the program specifically. Just as people can only live on Earth, but if you want to go to the moon, please put on the space suit. The application domain here is a bit like a space suit. Silverlight Full Range-the architecture is in fact hesitant about whether to talk about Silverlight's architecture. A lot of people are not very willing to see these theories of things. But I would like to know about your understanding and familiarity with Silverlight is very helpful. Although you may have doubts when you look at it, I think I should slowly uncover it later. So I decided to talk about it. Summary What is silverlight? Relationship between Silverlight and the. NET Framework · Simple understanding of the Silverlight platform what is Silverlight Similar to the effect of flash in Web pages, just Silverlight good and server communication, can take advantage of Silverlight to provide a better interface experience while stronger than Flash. It is a typical program running in the sandbox, which means it can only have limited access to resources on the client machine, but it provides a good user experience. If you want to compare it with flex technology only. In order to understand the convenience I mentioned in the previous flash. The above shows that if we want to run Silverlight we have to install its "plug-in", which is Microsoft Silverlight3Developer Runtime. When you install the Silverlight SDK or Silverlight Tools3.0Software forit will be installed when VS2008. Only applications that have runtime installed can run Silverlight. The installation package for this runtime includes:1plug-in for programs that host Silverlight apps. 2. Supports the infrastructure that runs the program. The Silverlight and. NET Framework relationships are strictly, Silverlight is a subset of. NET FRAMEWORKD. Silverlight has its own set of frameworks, called. NET Framewor forSilverlight. Although the framework looks similar to the architecture of the. NET Framework, they are actually different. The. NET Framework forSilverlight is new, but is supported by the. NET Framework. If your machine does not have a. NET Framework package installed, you can run Silverlight as long as you install Microsoft Silverlight3Developer Runtime. Here are a few points to note: • If you build a. NET Framework-based project, the related assemblies in your project where you can apply Silverlight include the SDK and runtime. If you build a Silverlight application or class library project, it is not possible for you to reference assemblies in the. NET Framework. Because the. NET Framework is not supported within the scope of Silverlight. That is, it can support Silverlight for the. NET Framework, but it does not support development for the. NET Framework for Silverlight. This means that if you are developing a Silverlight application, your original. NET Framework-based stuff cannot be used directly. However, in vs2008, you can adjust the properties of a class library project to transform the current. NET Framework project into a. NET Framework forthe Silverlight project. Setup step: Select the project file> Right-click > Click Properties > In Properties ' Applications ' >>tick "Use only client frame Word set" Now we are actually facing two. NET Framework, one is the traditional one is for Silverlight. Although they use different frameworks in development, they have a high degree of similarity, almost originally defined in. Net The underlying classes on the framework are preserved intact in the Silverlight framework, including the class name, usage, and so on. There is a good way to do this, and we just need to refer to the corresponding assemblies under different frameworks to implement the transformation from. NET framekwork to Silverlight. A simple understanding of the Silverlight platform before you begin to understand the Silverlight platform, look at the XAP packages mentioned in the previous section. You can put the Hello Word application (maybe you're done, if not you can build a new one, Just compile it. Helloworld.xap in the project under the ClientBin folder is copied to any place, and the suffix is changed from xap to zip. Then use the tool to open it and see what's in the so-called package. If your program is simple enough you will see two files AppManifest.xaml and HelloWorld.dll files that will be downloaded to the client and then run by the client runtime. Here are a few steps: • Upon request, the Silverlight XAP package and associated resources are downloaded locally (this process is triggered by the Silverlight plugin). On the client, once the package has been downloaded, it will be loaded into the program domain for execution. In other words, the Silverlight platform is running on the client side, not on the server like ASP. For the Silverlight platform, it is made up of the core presentation framework, the. NET Framework forSilverlight and a setup and update component. If he is running on the client platform. So why is it possible to debug on the server? Because when you are checked in the Properties-silverlight Debug. On behalf of. Supports client-side debugging. Similar to Firebug. So the JS debugging is disabled. And. The tool integrates the runtime (the running environment on the browser). So you can communicate directly in Silverlight and at run time. Implement breakpoint Debugging. The component description core represents the components and services that the layer framework faces for UI and user interaction (including user input, lightweight UI controls for WEB applications, media playback, digital rights management, and data binding), and presentation layer functionality (including vector graphics, text, animations, and images). It also includes extensible Application Markup Language (XAML) for specifying layouts. The. NET Framework forThe Silverlight. NET Framework contains a subset of components and libraries, including data integration, extensible Windows controls, networks, base class libraries, garbage collection, and the Common language runtime (CLR). The. NET Framework forSome parts of Silverlight are deployed through the application. These"Silverlight Library"is an assembly that is not included in the Silverlight runtime but will be available in the Silverlight SDK. When you use the Silverlight library in your application, they are packaged with the application and downloaded to the browser. These libraries include new UI controls, XLINQ, consolidation (rss/Atom), XML serialization, and Dynamic Language runtime (DLR). Setup and updates are an installation and update control that simplifies the process of installing the application for the first time and provides low-impact automatic Updates later. I don't want to copy this from the Silverlight documentation, but how can I not explain it? Although the above explanation is somewhat uncomfortable to understand, then it is better to explain it better than without a standard. And I'm going to copy a picture of them here, but I'll make a clear explanation of all this after doing it. So I hope you can read it. CLIP_IMAGE018 you can see that I have divided the above into three parts. C: Represents a component that supports the installation and update of Silverlight. It can also be said that C is what we call plug-ins, but not exactly. Integrated network protocol stack: it is required to communicate over the network. DOM Integration: It is necessary to communicate well with the browser, and Silverlight is not able to deal with the browser. Application services: Provides the necessary services to start, mount, and maintain applications that cannot be run without Silverlight. Setup: As the technology is upgraded, the corresponding Microsoft Silverlight Developer Runtime is constantly updated. It provides a way to intelligently update the necessary components. B: This part mainly deals with the processing of graphics, rendering, media processing and receiving input, and it mainly deals with the operating system and hardware support. Without it Silverlight is not able to help you to provide a variety of visual auditory and media processing effects. Between B and a you can see that it is XAML that you can access through the definition of XAML directly to the support provided in B (the original traditional concept, if we are going to get similar support only through the. NET Framework provided by the API. But now you can not only access it programmatically through the API, but also through the way XAML is defined. In other words, you have two sets of APIs that you can use to achieve the same purpose. Of course, XAML is more than just a function of accessing B. It can be implemented in XAML, almost as you can with code. This is a very interesting point. A: Is the. NET Framework forSilverlight We feel more familiar with a part that resembles the architecture of the. NET Framework even the name of the class is almost identical, although it is entirely new to the. NET Framework. I don't have much to explain here. The gray area on the right side of a is not part of the. NET Framework forPart of Silverlight, which is designed to support the ability to develop Silverlight in a browser in a way that is scripted.

How Silverlight Works

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.