The Silverlight application model in Visual Basic .NET

Drawer QR Code 2d barcode in Visual Basic .NET The Silverlight application model

Download from Wow! eBook <www.wowebook.com>
Paint Denso QR Bar Code In VB.NET
Using Barcode encoder for .NET framework Control to generate, create QR Code image in .NET framework applications.
www.OnBarcode.com
QR Code Recognizer In Visual Basic .NET
Using Barcode decoder for Visual Studio .NET Control to read, scan read, scan image in .NET applications.
www.OnBarcode.com
The Silverlight application model
Create Code-128 In Visual Basic .NET
Using Barcode creation for .NET Control to generate, create Code-128 image in Visual Studio .NET applications.
www.OnBarcode.com
Printing UPC Code In VB.NET
Using Barcode creation for .NET Control to generate, create Universal Product Code version A image in .NET applications.
www.OnBarcode.com
Browser loads HTML and files
Print Linear In Visual Basic .NET
Using Barcode maker for .NET framework Control to generate, create 1D Barcode image in Visual Studio .NET applications.
www.OnBarcode.com
Create EAN / UCC - 13 In VB.NET
Using Barcode encoder for .NET Control to generate, create GS1 128 image in .NET framework applications.
www.OnBarcode.com
Required version installed Yes XAML or XAP Xap Custom splash screen
Creating Code 39 In VB.NET
Using Barcode encoder for Visual Studio .NET Control to generate, create Code 39 Extended image in VS .NET applications.
www.OnBarcode.com
Code 2 Of 5 Generation In VB.NET
Using Barcode generator for VS .NET Control to generate, create 2 of 5 Industrial image in .NET applications.
www.OnBarcode.com
Display install experience
Generating Denso QR Bar Code In Objective-C
Using Barcode generator for iPad Control to generate, create QR Code ISO/IEC18004 image in iPad applications.
www.OnBarcode.com
Scanning Quick Response Code In VS .NET
Using Barcode recognizer for VS .NET Control to read, scan read, scan image in .NET framework applications.
www.OnBarcode.com
Xaml
Read Data Matrix In Visual Basic .NET
Using Barcode scanner for Visual Studio .NET Control to read, scan read, scan image in VS .NET applications.
www.OnBarcode.com
Making EAN13 In Visual Studio .NET
Using Barcode encoder for ASP.NET Control to generate, create EAN13 image in ASP.NET applications.
www.OnBarcode.com
Load custom splash XAML and wire events
Encode GS1 DataBar-14 In .NET
Using Barcode creation for VS .NET Control to generate, create GS1 DataBar Limited image in VS .NET applications.
www.OnBarcode.com
Drawing Code 128 Code Set C In Objective-C
Using Barcode creator for iPad Control to generate, create Code 128 Code Set C image in iPad applications.
www.OnBarcode.com
Show default splash screen
UCC - 12 Drawer In Java
Using Barcode printer for Java Control to generate, create UPC Code image in Java applications.
www.OnBarcode.com
Paint Barcode In None
Using Barcode creation for Font Control to generate, create Barcode image in Font applications.
www.OnBarcode.com
Downloiad XAP
2D Maker In Visual Studio .NET
Using Barcode printer for .NET framework Control to generate, create Matrix 2D Barcode image in .NET framework applications.
www.OnBarcode.com
Create UPC-A Supplement 5 In Java
Using Barcode drawer for Eclipse BIRT Control to generate, create GS1 - 12 image in BIRT applications.
www.OnBarcode.com
Read app manifest
Painting 1D In VS .NET
Using Barcode printer for ASP.NET Control to generate, create 1D Barcode image in ASP.NET applications.
www.OnBarcode.com
GTIN - 12 Scanner In VB.NET
Using Barcode scanner for .NET Control to read, scan read, scan image in Visual Studio .NET applications.
www.OnBarcode.com
Load assemblies
Instantiate entry point class
Call JavaScript event handlers
Call app startup handler
Load root visual
Render/Run
Figure 3.1 The Silverlight startup process. This flowchart describes the loading process from the load of the HTML page through to the execution of the events on the root visual of a Silverlight application.
Download from Wow! eBook <www.wowebook.com>
The application model and the plug-in
XAP step is what makes the decision between the old Silverlight 1.0 model and the current Silverlight 2+ model. That decision is based on a combination of the source (a .xaml or .xap file) and the specified type property of the plug-in. The dotted line between the JavaScript and the managed code event handlers is there because, though you typically wouldn t do it, you can have both JavaScript and managed handlers active for the load event of the application. The order in which they fire in relation to each other isn t guaranteed. Some additional parts of the process aren t displayed in figure 3.1 but are interesting nonetheless. For example, when the Silverlight plug-in determines it ll have a managed code .xap file to work with, it loads the Silverlight .NET CLR (CoreCLR) into the memory space of the browser.
CoreCLR
Silverlight 2+ uses a version of the Common Language Runtime (CLR) known as CoreCLR. This is a version of the .NET CLR that has been optimized for size and use for client-side rich Internet applications (RIAs). The CoreCLR shares code with the full .NET CLR for core bits such as the type system, the workstation-optimized garbage collector, and the just-in-time (JIT) compiler. These size optimizations and intelligent decisions on what is and isn t necessary for a client-side RIA allow the Silverlight plug-in, including the CoreCLR, to come in at around 5 MB total size. For more details on CoreCLR, see Andrew Pardoe s CoreCLR MSDN article at http:// msdn.microsoft.com/en-us/magazine/cc721609.aspx.
Apparent in all this is that the most important artifact in the process is the Silverlight application itself: the .xap file.
A managed code Silverlight application is packaged into a .xap when built. A .xap is simply a ZIP file and may be inspected by renaming it to .zip and opening it with any zip-compatible archiver. The contents of a typical .xap file are shown in figure 3.2. This compressed file will always contain MyApp.xap a manifest file named AppManifest.xaml. In MyApp.dll AppManifest.xaml addition, there will always be a .dll file that Additional Libraries (.dll) serves as the entry point into the Silverlight application. This application may require Packaged Content (images, media) other Silverlight libraries, service connecServiceReferences.ClientConfig tion information, or other types of content. Content items and additional libraries may be in the application .xap file or downFigure 3.2 Structure of a typical .xap file loaded at runtime; either way, they represhowing the types of files that are normally included sent the dependencies of the application.
Download from Wow! eBook <www.wowebook.com>
The Silverlight application model
Because the .xap file is a ZIP-compatible compressed archive, you may alter its contents and rezip it after compilation. Reasons for doing this include updating the service references to move from (for example) a test environment to a production environment or altering other environment or customer-specific XML configuration files, branding assets, or other content. You can also slightly decrease a .xap file s size by rezipping it with an efficient ZIP tool such as 7-Zip, at the expense of a slightly slower decompression and application startup time on older machines. This may be important in situations where bandwidth is at an extreme premium. The .xap contains a number of different files. One of which is the file that tells Silverlight what other files the .xap contains and where to find the application entry point the application manifest file.
The application manifest file The manifest file is responsible for describing the Silverlight application to the Silverlight runtime. This file is created at build time by Visual Studio and is typically not hand edited. The Silverlight runtime reads the AppManifest.xaml file beginning with the rootmost element, Deployment. This element exposes two attributes that tell the Silverlight runtime how to start the Silverlight application, as shown here:
<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" EntryPointAssembly="MyApp" EntryPointType="MyApp.App" RuntimeVersion="4.0.50401.0"> <Deployment.Parts> <AssemblyPart x:Name="MyApp" Source="MyApp.dll" /> </Deployment.Parts> </Deployment>
This example shows a basic manifest file, which uses the EntryPointAssembly and EntryPointType attributes to launch the Silverlight application. The first attribute, EntryPointAssembly, will always reference one of the AssemblyPart elements in the Deployment.Parts section. The second attribute, EntryPointType, explains which class should be used to start the Silverlight application. The third attribute, called RuntimeVersion, broadcasts the version of the Silverlight runtime that the Silverlight application was built with.
NOTE AppManifest.xaml is generated during project compilation based on the settings found in the project s property pages. If you change the name and/or namespace of the startup application class (App), then you must adjust the Startup object setting in the Silverlight property page. If you forget to make these changes, you ll get a runtime error mentioning an invalid or missing Silverlight application.
The Deployment section of the manifest contains two sections:
Copyright © OnBarcode.com . All rights reserved.