XAML Developer's Reference VERSION Copyright 2015 Jade Software Corporation Limited. All rights reserved.

Size: px
Start display at page:

Download "XAML Developer's Reference VERSION Copyright 2015 Jade Software Corporation Limited. All rights reserved."

Transcription

1 VERSION Copyright 2015 Jade Software Corporation Limited. All rights reserved.

2 Jade Software Corporation Limited cannot accept any financial or other responsibilities that may be the result of your use of this information or software material, including direct, indirect, special or consequential damages, or loss of profits. There are no warranties extended or granted by this document or software material. You should be very careful to ensure that the use of this software material and/or information complies with the laws, rules, and regulations of the jurisdictions with respect to which it is used. No part of this document may be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose, without the express written permission of Jade Software Corporation Limited. The information contained herein is subject to change without notice. Revisions may be issued to advise of such changes and/or additions. Copyright 2015 Jade Software Corporation Limited. All rights reserved. JADE is a trademark of Jade Software Corporation Limited. All trade names referenced are the service mark, trademark, or registered trademark of the respective manufacturer. For details about other licensing agreements for third-party products, you must read the JADE ReadMe.txt file.

3 Contents Contents Before You Begin Who Should Read this Guide What's Included in this Guide Related Documentation Conventions iii vii vii vii viii viii Chapter 1 Introduction to JADE XAML 10 Overview 10 XAML Hierarchy 12 JADE XAML Requirements 12 Developing a JADE XAML Application 14 Comparison of the Silverlight Application Types 15 Defining a Silverlight Application 16 JADE Silverlight Stateless Applications 17 JADE Silverlight Stateless Application Definition Components 18 Running a Silverlight Stateless Application 19 Defining the WebSession Class 22 Defining the IIS Environment 23 Generating the XAP and HTML Files for a Silverlight Stateless Application 23 Generation Steps 25 Requirements to Generate XAP and HTML Files 26 Debugging a Silverlight Stateless Application 26 Handling Exceptions in a Silverlight Stateless Application 26 JADE Silverlight Stateful Thin Client Applications 27 Deploying a JADE Silverlight Stateful Thin Client Application 27 Running a JADE Silverlight Stateful Application 28 Chapter 2 Using the XAML Browser 29 Accessing the XAML Browser 29 Navigating around the XAML Browser 32 Using the XAML Menu 33 Using Function Keys and Shortcut Keys 34 Using Browser Shortcut Keys 34 Caret Movement Shortcut Keys 34 Extending Selected Blocks Shortcut Keys 35 Insert and Delete Shortcut Keys 35 Using the Mouse within the XAML Sheet 36 Using the Mouse within the Line Number Margin 36 Adding a New Document 36 Searching for a Document 38 Editing an Existing Document 39 Using the Edit Menu 40 Undo Command 40 Redo Command 41 Cut Command 41 Copy Command 41 Paste Command 42 Select All Command 42 Find/Replace Command 42 Find Again Command 44 Find At Caret Command 44 Deleting a Document 44 Renaming a Document 45 Refreshing the View 46 Maintaining Properties for Your Document 46 Saving Your Document 47

4 Contents iv Save Errors 48 Invalid XAML 49 Parsing Errors 50 Single Quotes in the XAML 50 Comparing the XAML Changes in Parent and Subdocuments 51 Saving Your Document as another Name 52 Generating XAP and HTML Files 53 Selecting the XAML Browser Mode 54 Hiding or Showing the Toolbar 54 Chapter 3 Painting XAML Documents 56 Using the XAML Painter 56 Accessing the XAML Painter 57 Properties Area of the XAML Painter 59 Expanding or Contracting the View of a Document 61 Painting Area of the XAML Painter 62 XAML Area of the XAML Painter 62 Using Function Keys and Shortcut Keys 63 Creating a XAML Document 64 Adding a New XAML Document 65 Subclassing XAML Controls and Documents 67 Control Subclassing 67 Document Subclassing 67 Adding UI Elements to Your Document 68 Selecting a UI Element 69 Cloning UI Elements 70 Naming a UI Element 71 Adding Container UI Elements 71 Changing the Caption Content of a UI Element 72 Overlapping UI Elements 73 Changing the Runtime Tab Sequence 74 Obtaining Help for a UI Element 74 Defining the Layout of Your XAML Document 74 Sizing Your UI Elements 75 Aligning Your UI Elements 76 Spacing Your UI Elements 76 Options Panel Check Boxes 77 Using Grid Lines to Position UI Elements on XAML Documents 77 Locking the Position of UI Elements on Your Document 78 Direct Select Functionality 78 Previewing UI Elements on Your Document 79 Examples of Laying Out UI Elements 80 Maintaining Properties for Your XAML Document or UI Element 81 Maintaining General Properties 82 Maintaining Size and Position Properties 83 Maintaining Colors and Styling Properties 83 Selecting a Color 84 Maintaining Font Properties 86 Maintaining Grid Definitions 86 Maintaining Miscellaneous Properties 87 Maintaining Transformations 88 Defining Methods for Your Document 89 Saving Your Document 89 Editing an Existing Document in the XAML Painter 89 Using the Keyboard and Mouse to Edit Your Document 90 Selecting Multiple UI Elements 90 Changing the Size of Selected UI Elements 91 Moving UI Elements around Your Document 91 Copying UI Elements 91

5 Contents v Displaying the Properties for a UI Element 91 Placing a UI Element on a Container UI Element 91 Removing a UI Element from Your Document 92 Changing a UI Element Type 92 Effects of Editing an Existing Document 93 Deleting a Document 93 Layout Toolbar 93 Align Bottom Button 94 Align Top Button 95 Align Left Button 95 Align Right Button 95 Vertically Adjacent Button 95 Horizontally Adjacent Button 96 Align Centers Vertically Button 96 Align Centers Horizontally Button 96 Space Evenly Down Button 96 Space Evenly Across Button 97 Same Width Button 97 Same Height Button 97 Chapter 4 Considerations When Developing Silverlight Applications 98 Using Third-Party Controls 98 Third-Party Control Usage in JADE Silverlight Stateless Applications 98 registereventhandler Method for DataTemplate Controls 100 Third-Party Control Usage in JADE Silverlight Stateful Applications 101 Abstract Classes and Third-Party Controls 101 Accessing.NET Objects 102 Accessing Silverlight Fields and Properties 102 Accessing Silverlight Methods 102 Overloaded.NET Methods 102 Constructors 103 Specifying a Type 103 Enums 103 Using Layout Manager UI Element Types 104 Canvas UI Element Type 105 StackPanel UI Element Type 105 Grid UI Element Type 106 Using the Grid Assistant 110 Grid Assistant Popup Menu 112 Using Resources in XAML Documents 113 Creating Controls Dynamically or from a Template 114 Use of the itemssource Property by Different XAML Classes 115 XamlSelector and XamlDataGrid Class Use of the itemssource Property 115 XamlAutoCompleteBox Use of the itemssource Property 116 Unit Testing Silverlight Applications 117 Adding Silverlight Unit Tests to the JADE Unit Testing Framework 117 Configuring a Silverlight Stateful Application to Run Unit Tests 119 Configuring a Silverlight Stateless Application to Run Unit Tests 119 Running the Silverlight Application Unit Tests 121 Viewing Failed and Ignored Tests 122 Testing the Behavior of Silverlight UI Elements 124 Appendix A Silverlight Terms and Frequently Asked Questions (FAQs) 128 Brush 128 Border 128 Panel 128 Text Boxes and Similar Controls 129 Content Control 129

6 Contents vi Scroll Viewer 129 Tab Control and Tab Item 129 Button, Toggle Button, Radio Button, and Check Box 130 Items Control 130 Shapes 130 Frequently Asked Questions 130 How do I load the contents of a combo box or list box with strings? 130 How do I load the contents of a combo box or list box with an image and a string? 130 How do set the caption of a button? 131 How do I set an image in a button? 131 How do I create a layout where the controls automatically resize when the browser resizes? 131 How do I set the background brush of an element in JADE logic to be a solid color, a linear image, an image, or to use a gradient? 132 How can I use logic to change the way the border of a control is presented? 132 What XAML UI element is most similar to the classical UI Table class, and how do I populate it? 133 How do I control which document is shown to the user? 134 How can I rotate text? 134 How can I dynamically draw on a window? 134 How do I create and use a splitter? 134 How do I set up radio buttons in Silverlight? 135 What is the difference between the various types of panels and how do I use them? 135 How do I set the contents of a label in Silverlight? 136 How do I set up and control a scrollable item in Silverlight? 136 How do I use a calendar control in Silverlight? 136 How do I use the date picker control in Silverlight? 136 How do create a password field in Silverlight? 137 What is the XamlRangeBase class and where would I use it? 137 How do I control a progress bar in Silverlight? 137 Is there an equivalent control to the busyindicator in Silverlight? 137 How do I detect that the Silverlight equivalent of a Folder control has changed sheets? 137 How do I set up a hierarchical list box? 138 What is XamlTabItem and how do I use it? 138 How do I set up and use a hyperlink button? 138 How do I specify an image and a label divided by 10 pixels as a content of a button? 138 How do I resize the following scenario if somebody resizes the browser? 139

7 Before You Begin The JADE XAML Developer s is intended as the main source of information when you are developing or maintaining JADE applications using the Extensible Application Markup Language (XAML). This document provides reference to JADE's XAML classes, which are wrapper classes for Microsoft Silverlight functionality. Much of the documentation for these classes has been sourced from Microsoft's Developer Network Library Web site, available at: Copyright of this material remains with Microsoft Corporation. Who Should Read this Guide The main audience for the JADE XAML Developer s is expected to be developers of JADE application software products using XAML. What's Included in this Guide The JADE XAML Developer s has four chapters and one appendix. Chapter 1 Chapter 2 Chapter 3 Chapter 4 Appendix A Provides an overview of JADE XAML Provides instructions for using the XAML Browser Provides instructions about using the XAML Painter to paint XAML documents Provides details about considerations when developing a Silverlight application Provides Frequently Asked Questions (FAQs) and an overview of JADE XAML terminology Example Resources The JADE examples download contains the following example resources. XamlStatelessSchema, which is a stateless example of the Erewhon system. This requires the standard Erewhon schemas to be installed. SilverlightBasic, which is a testing resource that includes an example of the handling of every type of XamlUIElement, their properties, methods, and events. In addition, it includes subclass handling. The XamlStatelessSchema (and other Silverlight examples) are available from the following URL. After you have installed the JADE_Examples.zip file, the example schemas and the JADE Erewhon Silverlight Guide are located in examples/silverlight/examples of your JADE directory.

8 Before You Begin viii Related Documentation Other documents that are referred to in this guide, or that may be helpful, are listed in the following table, with an indication of the JADE operation or tasks to which they relate. Title JADE Encyclopaedia of XAML Classes JADE Initialization File JADE Installation and Configuration Guide JADE Platform Differences Guide JADE Development Environment User s Guide JADE Thin Client Guide JADE Web Application Guide Related to Extensible Application Markup Language (XAML) classes Maintaining JADE initialization file parameter values Installing and configuring JADE Platform differences when running JADE applications Using the JADE development environment Administering JADE thin client environments Implementing, monitoring, and configuring Web applications Conventions The JADE XAML Developer s uses consistent typographic conventions throughout. Convention Description Arrow bullet ( ) Step-by-step procedures. You can complete procedural instructions by using either the mouse or the keyboard. Bold Italic Blue text Bracket symbols ( [ ] ) Vertical bar ( ) Monospaced font ALL CAPITALS SMALL CAPITALS Items that must be typed exactly as shown. For example, if instructed to type foreach, type all the bold characters exactly as they are printed. File, class, primitive type, method, and property names, menu commands, and dialog controls are also shown in bold type, as well as literal values stored, tested for, and sent by JADE instructions. Parameter values or placeholders for information that must be provided; for example, if instructed to enter class-name, type the actual name of the class instead of the word or words shown in italic type. Italic type also signals a new term. An explanation accompanies the italicized type. Document titles and status and error messages are also shown in italic type. Enables you to click anywhere on the cross-reference text (the cursor symbol changes from an open hand to a hand with the index finger extended) to take you straight to that topic. For example, click on the "What's Included in this Guide" cross-reference to display that topic. Indicate optional items. Separates alternative items. Syntax, code examples, and error and status message text. Directory names, commands, and acronyms. Keyboard keys.

9 Before You Begin ix Key combinations and key sequences appear as follows. Convention KEY1+KEY2 KEY1,KEY2 Description Press and hold down the first key and then press the second key. For example, "press SHIFT+F2" means to press and hold down the SHIFT key and press the F2 key. Then release both keys. Press and release the first key, then press and release the second key. For example, "press ALT+F,X" means to hold down the ALT key, press the F key, and then release both keys before pressing and releasing the X key. In this document, the term Microsoft Windows refers to Windows 10, Windows 8, Windows 7, Windows Server 2012, Windows Server 2008, Windows Vista, or Windows Mobile. When there are differences between the versions of Microsoft Windows, the specific version of Microsoft Windows is stated. With the exception of the jade.exe program, when referring to program executables in this document, the.exe file suffix is omitted; for example, jadclient refers to jadclient.exe. Similarly, the.dll (Dynamic Link Library) suffix is omitted. For example, jomos refers to jomos.dll.

10 Chapter 1 Introduction to JADE XAML This chapter covers the following topics. Overview Overview XAML Hierarchy JADE XAML Requirements Developing a JADE XAML Application Comparison of the Silverlight Application Types Defining a Silverlight Application JADE Silverlight Stateful Thin Client Applications Deploying a JADE Silverlight Stateful Thin Client Application Running a JADE Silverlight Stateful Application JADE Silverlight Stateless Applications JADE Silverlight Stateless Application Definition Components Running a Silverlight Stateless Application Generating the XAP and HTML Files for a Silverlight Stateless Application Debugging a Silverlight Stateless Application Handling Exceptions in a Silverlight Stateless Application In this chapter, the term XAML indicates the Silverlight Extensible Application Markup Language (XAML) implementation. For details about XAML terminology, see Appendix A. JADE XAML enables you to create rich Web applications that run on Windows; that is, you can develop applications that run in a browser and that use the Microsoft Silverlight presentation facilities. Note Silverlight does not run in a 64-bit mode or from a 64-bit thin client. As Microsoft does not yet support Silverlight in the 64-bit version, the XAML Browser or XAML Painter requires a 32-bit presentation client JADE version. User interfaces in XAML applications are: Declared in the Windows Presentation Foundation (WPF) Extensible Application Markup Language (XAML). Programmed using a subset of the.net framework. Textual content created with XAML can be searched and indexed by search engines, because it is represented as XAML text rather than being compiled. The XAML Browser and XAML Painter JADE Silverlight applications enable you to define user interfaces in XAML. For details, see "Using the XAML Browser", in Chapter 2, and "Using the XAML Painter", in Chapter 3.

11 Chapter 1 Introduction to JADE XAML 11 Microsoft Silverlight is a browser plug-in similar to Adobe Flash. Silverlight must be installed on the client computer (that is, the computer that will be using a Web browser). It can be downloaded from Microsoft. For details, see "JADE XAML Requirements", later in this chapter. A normal HyperText Markup Language (HTML) page is used to host the XAML User Interface (UI) element. An <object> tag with various information about the XAML application being referenced is present in an HTML page. Microsoft recommends that certain other HTML tags and JavaScript routines are present in this HTML file. Depending on the Silverlight application type, JADE generates a skeleton HTML file automatically or on request, with the user XAML application embedded that conforms to these requirements. You can then alter this HTML file to meet your requirements. By default, the XAML application encompasses the entirety of the page, or document; however, it may be confined to any arbitrary region of the page. A Microsoft Silverlight application has the.xap suffix (XAML Application). You can define the following types of Silverlight-based applications in JADE. A stateless Web services-like version, where all presentation layout and logic handling is executed in the browser and requires no communication with the JADE client (standard client or application server). Communication to the JADE system that performs the associated database logic is via Microsoft Internet Information Server or Apache Web Server (hereafter referred to as IIS). One or more copies of the JADE application process the requests for all users. A Silverlight stateless application consists of the definition of: The presentation handling that runs entirely in the browser. The JADE logic that provides access to the database layer that runs in a standard or application server client. Classes and methods that provide the communication between the two components. Any transient objects that are created in user code should be deleted when they are no longer required. The only data that can be retained between requests is that data stored on the WebSession object, if that feature is configured. For details, see "Defining the WebSession Class", later in this chapter. The JADE presentation code is translated into equivalent Silverlight C# code and compiled into a runtime Silverlight Application (.xap) module that is loaded by the browser when the application HTML link is selected in the browser by the user. The JadeAgl.xap file module handles the initiation process, the configuration requirements, the packaging and un-packaging of non-browser method requests, and communication with IIS via a URL that is specified in the HTML file. A thin client-based version, where all JADE logic runs in the application server and communication to the browser hosting the content is performed via a dedicated TCP/IP connection from the workstation of the user. A JADE Process instance is used by every connected user and the application session retains the current state of transient objects over subsequent transmissions from the browser. This mode of operation is referred to as the stateful mode. Every logic reference to Silverlight GUI properties and methods is sent from the application server to the browser in the client s PC. These result in a significant increase in the amount of network traffic compared to standard thin client JADE, because the application server has no local knowledge of GUI property values. As a result, this type of application is probably suitable only for use over a fast LAN network.

12 Chapter 1 Introduction to JADE XAML 12 As the JADE XAML presentation client is contained in the JadeAgl.xap file, your HTML files should reference this file. This XAML application acts as the JADE presentation client, communicating with the JADE application server and running the user JADE application. The architecture is similar to the traditional JADE presentation client, but instead of jade.exe being used as the presentation client, JadeAgl.xap runs inside the Web browser and acts as the presentation client. For details, see "Comparison of the Silverlight Application Types" and "Defining a Silverlight Application", later in this chapter. In this document, an HTML file is referred to as an HTML document and the presentation of that file on a Web browser at run time is referred to as an HTML page. XAML Hierarchy The XAML control hierarchy is located under the XamlObject class, which is inherited from the RootSchema Object class. For details about XAML classes and properties, see your JADE Encyclopaedia of XAML Classes. Additional details are available from the following URL. Note Classes marked abstract in the previous hierarchies are abstract in Silverlight and you cannot create them. However, as they are not abstract in JADE, when an instance of a third-party control is created, its parent hierarchy is traversed until a matching RootSchema class is found (for example, XamlUIElement) and an instance of that class is returned. JADE XAML Requirements JADE XAML requires the Microsoft Silverlight 4 plug-in, which you can download from to be installed on presentation clients. The following files must be installed in the bin directory of your application server. File JadeAgl.xap JadpmapSL.dll XamlPainter.xap AglPreview.xap Required for JADE presentation clients JADE application server extension XAML Painter JADE previewer The AglPreview.xap, XamlPainter.xap, and JadeAgl.xap files do not need to be present on the presentation client. When you initiate the XAML Painter or XAML Browser from the JADE development environment, the XAP files are copied from the application server to the temporary directory on the presentation client prior to initiation of these applications. In addition, when you initiate the XAML Painter, a jadexamlpainter.html file is dynamically created on the application server and then copied the temporary directory on the presentation client. These files are required during development of Silverlight applications. At run time, only the presentation client JadeAgl.xap file and the application server extension JadpmapSL.dll file are required.

13 Chapter 1 Introduction to JADE XAML 13 When a Silverlight application is initiated from the JADE development environment, the HTML file used to initiate the application is dynamically generated and written to the temporary directory on the presentation client prior to initiation of the application. You can define your own HTML file to be used for Silverlight application initiation by setting the HtmlFile parameter in the [JadeSilverlight] section of the JADE initialization file on the application server. The HtmlFile parameter specifies the location of the HTML file to be used when the JADE XAML Painter is opened or a Silverlight application is run from the JADE development environment. The default parameter value is <default>, which means that JADE generates an HTML file from the internally stored definition. Specify a value other than null or <default>, to specify the location of the HTML file to be used. This parameter enables you to control the contents of the HTML. However, it must have a section of <param name="initparams" value=""/> where JADE will insert the initiation parameters required to start the Silverlight application, as shown in the following example. [JadeSilverlight] HtmlFile=c:\JADE\Silverlightdefault.html If the HtmlFile parameter is specified, the Silverlight <object> element must contain the following element that contains initparams values required to connect to the JADE application server and run an application. <param-name="initparams" value=""/> Any parameter specified other than App, Schema, AppServer, and AppServerPort is retained. Notes To run a Silverlight stateless application, you must first generate the required XAP and HTML files. For details, see "Generating the XAP and HTML Files for a Silverlight Stateless Application", later in this chapter. A JADE Silverlight stateful thin client application server must be run on a port number in the range of 4502 through This limitation is imposed by Microsoft, as TCP/IP connections from Silverlight applications back to the Web server are allowed only in this range. If a document is not defined for the current locale of your presentation client, the XAML Painter does not try to use another locale, which is usually the default locale; that is, English (New Zealand). The XAML Browser previews a document and loads its XAML only if there is XAML for your current (system) locale. You must therefore set your base locale (for example, select English (New Zealand) in the Base Locale combo box on the Miscellaneous sheet of the Preferences dialog) so that the XAML for your base locale can be located, the XAML loaded, and the document previewed and displayed in the XAML Painter. By default, a Silverlight presentation client sends and receives unencrypted data over the TCP/IP connection to the application server. As Silverlight does not support Secure Sockets Layer (SSL)-style encryption for TCP/IP, it is not available for JADE use. You can enable encryption for all Silverlight presentation clients connecting to an application server by setting the TcpEncryptionType parameter in the [JadeSilverlight] section of the JADE initialization file on the application server, as shown in the following example. [JadeSilverlight] TcpEncryptionType=aes-128 The aes-128 value enables 128-bit Advanced Encryption Standard (AES) encryption using private/public key exchange. A jommsg.log entry is generated confirming that encryption is in use. The other valid values are none (the default value) or empty (blank), meaning no encryption is required. Any other value reports an error and a value of none is assumed.

14 Chapter 1 Introduction to JADE XAML 14 Developing a JADE XAML Application When developing a JADE XAML application, you paint pages, or documents, that become subclasses of the XamlDocument class. The XamlDocument class is the Silverlight equivalent of the Form class in the classical JADE development environment. Form classes have references to controls, and those controls have events and event logic defined on them. This process is the same with the JADE Silverlight GUI except that you use different classes. XAML documents have references to User Interface (UI) elements, which have properties, events, and event logic defined on them. For an overview of User Interface (UI) element terminology, see Appendix A. The XamlDocument control subclasses are in the RootSchema hierarchy under the XamlUIElement class. (See also "XAML Hierarchy", earlier in this chapter.) HTML is a useful way of specifying graphical controls in XML. In a similar manner to HTML, Silverlight applications use Extensible Application Markup Language (XAML) to specify graphical controls UI elements. Although the JADE XAML Painter provides a What You See Is What You Get (WYSIWYG) interface, it is simply dealing with an underlying piece of XAML. Each XamlDocument subclass in JADE is essentially a piece of XAML; that is, text in Extensible Markup Language (XML) format, which you can access and edit directly through the JADE XAML Painter. (For details, see Chapter 3, "Painting XAML Documents".) This enables you to copy the XAML to third-party painters and tools and then import them back into JADE; for example, when defining complex animations or graphics in XAML beyond the scope of the XAML Painter. To create a JADE XAML application, you require the following components. 1. Using the XAML Browser or the XAML Painter, or both the XAML Browser and the XAML Painter, define the Silverlight documents that make up the pages that will be displayed to the user in the browser. 2. Using the JADE development environment, define the event methods that format and process the user actions required on those documents. For additional details about developing a Silverlight stateless application, see "JADE Silverlight Stateless Application Definition Components", later in this chapter. When developing a XAML application: The debugger functions normally. For details, see "Debugging a Silverlight Stateless Application", later in this chapter. Although you can use app.msgbox as normal, its flags support only Okay, Cancel, Yes, and No buttons. Note You can use app.msgbox in stateful (thin client) mode and in stateless mode. The write statement works normally when the application is run from the JADE development environment, but when you deploy and run a XAML application from outside of the JADE development environment, it writes to Silverlight Isolated Storage, which is a hard-to-locate directory on the presentation client that Silverlight uses to store application information. When you develop a XAML application using Silverlight: Stateless mode, XAML JADE methods defined with the webserverexecution method option indicate a method that transfers control from a browser back to JADE code via the implied Web service. Thin client mode, XAML JADE methods defined with the browserexecution method option are converted to C# code and the compiled code is downloaded to the Silverlight client. This enables you to minimize network traffic by performing specific user interface-related operations without requiring trips to the application server.

15 Chapter 1 Introduction to JADE XAML 15 An exception is raised when you specify the webserverexecution or browserexecution method option in a method defined in a class that is not allowed for stateless or presentation client Silverlight processing, respectively. Comparison of the Silverlight Application Types The following table compares the Silverlight presentation client-based and Silverlight stateless application types. Silverlight Presentation Client A JADE process is required for each user session. Requires an application server. Communication from the browser to the JADE process is via a dedicated TCP/IP connection. Network security is via Advanced Encryption Standard 128 Stateful. All transient objects created are retained and are available during the application session. All JADE logic is executed in the application server. Any reference to presentation objects requires a transmission from the application server to the browser. Not as scalable. An application server can support only a limited number of clients. To support more clients, more application servers are required. Uses the standard JADE environment only. No generation of the run time environment is required. JADE logic changes take immediate effect. Standard JADE debugging is available. Silverlight Stateless One or more copies of the JADE process are used by all connection clients. A standard JADE client or an application server can be used. Communication from the browser is via the standard Internet services using IIS or Apache. Standard browser network security via HTTPS (SSL). routines. Stateless. No transient object created can be retained and reused between requests sent to the JADE client. Web session handling can be enabled, which provides the ability to store data persistently on the WebSession object. Presentation logic is executed entirely in the browser. No communication to the JADE client is required to perform these functions. All database logic is executed in the JADE client. Scalable. The support of more clients requires only the initiation of more copies of the application. Uses the standard JADE environment. For the generation of the presentation module, Microsoft Visual Web Developer 2010 Express and Microsoft Silverlight 4 Tools for Visual Studio 2010 must be installed. Generation of the presentation layer is required. No generation of the JADE client application module is required. JADE logic changes to the JADE client module take immediate effect. Changes to the presentation layout and logic require re-generation and deployment of the presentation module. Standard JADE debugging is available for the JADE client module. Debugging the presentation module can be done only by running a presentation client-defined version of the application.

16 Chapter 1 Introduction to JADE XAML 16 Defining a Silverlight Application To run a XAML application, use the Define Application dialog to specify the Silverlight application type, which can be Silverlight (for a stateful thin client application), or Silverlight Stateless, Gui or Silverlight Stateless, Non-GUI (for a stateless application). For details about the Application sheet of the Define Application dialog, see "Defining Applications", in Chapter 3 of the JADE Development Environment User s Guide. To define a XAML application 1. In the Application Type combo box, select one of the following values. Silverlight, to specify a presentation client-based JADE XAML application. Silverlight Stateless, GUI, to specify a stateless Web services-like JADE XAML application, which creates the standard Web Monitor dialog that displays all received requests. Silverlight Stateless, Non-GUI, to specify a stateless Web services-like JADE XAML application, which does not create the standard Web Monitor dialog. Notes The Silverlight Stateless, Non-GUI application type terminates only after the JADE terminate instruction is executed. The Application class startapplication and startappmethod methods start only Silverlight Stateless, Non-GUI applications if they are invoked from a server method or server application. (An exception is raised if they are invoked from a server method or a server application to start an application of a type other than non-gui.) On a client node, they start all types of application. Running a JadeScript method when the currently selected application type is Silverlight or Silverlight Stateless, GUI changes the application type to GUI for the execution of that method. 2. In the Startup XAML combo box, select the XAML document that is to be displayed on start up. 3. If you are defining a Silverlight stateless application, select the initialize and finalize methods to be run by the JADE client logic when the application is initiated. These do not apply to the presentation browser-based module. Use the start-up document create method for any initialize logic that needs to be run initially in the browser. 4. If you are defining a Silverlight stateless application, on the Web Options sheet, define: a. The connection name and port that is used by the server application to connect to the JadeHttp.dll via TCP/IP; for example, localhost: b. The number of the application copies to be initiated. c. The session timeout value if sessions are enabled (for details, see the following section). d. The scheme being used; that is, http or https (SSL). e. The machine name to which the browser is to connect. f. The IIS virtual directory where the HTML and XAP files are located.

17 Chapter 1 Introduction to JADE XAML When you have saved your specified application values and clicked the OK button on the Define Application dialog, select the: XAML Painter command from the File menu, to open the XAML Painter and create a new document. For details, see Chapter 3, "Painting XAML Documents". XAML Browser command from the File menu, to open the XAML Browser; for example, if you want to navigate to or preview an existing document. For details, see "Accessing the XAML Browser", in Chapter 2. When you have created the new document class, you can edit the document. (There will be some basic XAML sitting in the document, based on the type of document that you specified.) JADE Silverlight Stateless Applications A JADE Silverlight stateless application is defined entirely in JADE and consists of: The XAML documents that will be displayed to the user. Methods to format and present XAML documents and handle GUI events. This logic is executed entirely in the browser and these methods must have browserexecution in their signature and must be marked as being browserexecution. No GUI manipulation can be performed by JADE client logic; only by browserexecution logic. In addition to primitive types and primitive type arrays, only a specific list of classes and their subclasses can use browserexecution in their method signatures. These classes are: XamlDocument XamlObject XamlManager XamlDataObject XamlDataObjectArray XamlDataObjectDictionary Application For details, see "browserexecution Option", in Chapter 1 of the JADE Developer s. When a class is extracted for the generation of the XAP file, only attributes (other than MemoryAddress attributes) and references of these types are extracted. All other properties are dropped from the class and are not available in the Silverlight stateless version of the class. The value of a constant is extracted (instead of the source) when JADE generates the XAP file, so constants that are not extracted do not cause a problem. To use constants that are defined on classes that are not extracted for a Silverlight stateless application, redefine the constants on a class that is valid in Silverlight in terms of the other (non-extracted) constant. For example: Define the constant on the class NotExtracted as: NotExtractedConst:Integer=123;

18 Chapter 1 Introduction to JADE XAML 18 Define the constant on the class IsExtracted as: NotExtractedConst:Integer=NotExtracted.NotExtractedConst; Note that the JADE compiler will check that in a browserexecution method, references are made only to: Other browserexecution methods webserverexecution methods on XamlDataObject subclasses in a stateless environment A restricted set of classes, properties, and methods in the RootSchema that are marked as allowbrowserexecution The only global class that can be referenced is the Application class. Application class property values are local only to where they are being referenced and they are not automatically transferred between the two modules. Global, Iterator, WebSession, Process, Node, and meta data (for example, Class) class references are not permitted. When a class is extracted for the generation of the XAP file, only properties of these types are extracted. Any other properties are dropped from the class and are not available in the Silverlight version of the class. You should not use properties of these classes if you intend to use the class in a stateless runtime operation. JADE methods that will be remotely called from the browser. These are methods marked as webserverexecution and are referenced in browserexecution methods. For details, see "webserverexecution Option", in Chapter 1 of the JADE Developer s. These methods, which can be defined only on subclasses of XamlDataObject, can pass only parameters and a return type of the following types. Primitives (including primitive arrays) Subclasses of XamlDataObject Subclasses of XamlDataObjectArray Subclasses of XamlDataObjectDictionary (dictionaries can have one key only) These parameters can be usage IO, input, or output. The browser logic is always the initiator of any communication between the browser and the JADE client. This communication always takes the form of one message out from the browser and one message in reply from the JADE client. Standard JADE logic associated with database access and update, called from the webserverexecution methods described in the previous item in this list. JADE Silverlight Stateless Application Definition Components To create a Silverlight stateless application, you require the following components. 1. Using the XAML Browser or the XAML Painter, or both the XAML Browser and the XAML Painter, define the Silverlight documents that make up the documents that will be displayed to the user in the browser. 2. Define the event methods that format and process the user actions required on those documents. These methods must be marked as being browserexecution. No GUI manipulation can be performed by JADE client logic; only by browserexecution logic.

19 Chapter 1 Introduction to JADE XAML 19 Notes You can subclass XamlUIElement classes and define event methods on those subclasses. When such a method is present and the associated event is called, that method is called first and when that method calls inheritmethod, the event method associated with the actual UIElement on the document is called. For example, if MyXamlButton is a subclass of XamlButton and has implemented the click event, clicking a button of that type (for example, btnok) calls the MyXamlButton::click method and when inheritmethod is called, the btnok_click method is called. Some browsers (for example, Mozilla and Chrome) allow additional events to be processed and cause the presentation to be repainted when a request to IIS is outstanding. For this reason, when an IIS request is outstanding, mouse events are disabled and key events are discarded so that the user cannot affect the presentation until the current actions are completed. This browser behavior can result in simultaneous requests being made to IIS. For example, if a document is loaded where multiple elements implement a loaded event that references webserverexecution methods, each loaded event will effectively be sent to IIS simultaneously. 3. Define the subclasses of XamlDataObject for objects that will be passed to and returned from JADE webserverexecution methods. 4. Define the JADE methods that will be remotely called from the browser. These are methods marked as webserverexecution and are referenced in browserexecution methods. These methods, which can be defined only on subclasses of XamlDataObject, can pass only parameters and a return type of the following types. Primitives (including primitive arrays) Subclasses of primitive arrays (for example, StringArray, StringUtf8Array, IntegerArray) Subclasses of XamlDataObject Subclasses of XamlDataObjectArray Subclasses of XamlDataObjectDictionary (dictionaries can have one key only) These parameters can be usage IO, input, or output. The browser logic is always the initiator of any communication between the browser and the JADE client. This communication always takes the form of one message out from the browser and one message in reply from the JADE client. These methods will pass the contents of the object on which the call is made, together with any parameters and any references to other objects defined. When the method returns, the content of the object on which the call was made is updated, together with any usage IO or output parameters. These methods: Must delete any transient objects created, other than those passed back Can reference any object defined within the JADE application except for any XamlDocument, XamlObject, or XamlManager classes Running a Silverlight Stateless Application You cannot run a Silverlight stateless application in the JADE development environment. To do so, you must create another application definition that is of Silverlight presentation client style; for example, to debug the application (for details, see "Debugging a Silverlight Stateless Application", later in this chapter).

20 Chapter 1 Introduction to JADE XAML 20 The following diagram is a depiction of the various parts of the Silverlight stateless runtime environment. To configure the runtime environment for Silverlight stateless applications, the following components are required, after you have specified the stateless application. To run a Silverlight stateless application 1. Configure the IIS or Apache Web Server environment in the same way that a Web service environment is defined. For details, see "Web Server Setup", in the Web Services Tips and Techniques white paper (available from and "Defining the WebSession Class" and the IIS definition example under "Defining the IIS Environment", later in this chapter. Note When you define the default values for your application pool, ensure that the Enable 32-Bit Applications option is set to False on the Application Pool Defaults dialog, as this is the correct setting for a 64-bit jadehttp.dll. 2. Copy the generated XAP and HTML files into the IIS virtual directory that is being used. For details about generating XAP and HTML files, see "Generating the XAP and HTML Files for a Silverlight Stateless Application", later in this chapter. 3. Initiate the JADE application, ready to process requests from the users. 4. Click on a link to the HTML file that describes the application environment to be initiated. For Microsoft security reasons, this link must be an HTTP or HTTPS link (SSL encryption) so that the domain in that link is the same domain used to obtain the XAP file. This HTML file is created by the JADE development environment during the generation process that is described under "Generating the XAP and HTML Files for a Silverlight Stateless Application", later in this chapter. 5. The browser processes the HTML file and then loads the XAP file from IIS that contains the modules required to be executed in the browser. This XAP file is generated by the JADE development environment. The logic loads and displays the start-up document defined on the JADE application.

21 Chapter 1 Introduction to JADE XAML 21 Note Browsers usually cache the XAP file, which will be downloaded again only when it is recognized as being different. 6. When the browser logic encounters a remote method call (a webserverexecution method), a call is made to IIS, passing the receiver object together with all of the parameter values. The method calling the webserverexecution method could be, for example, the create method of the document or an event defined on the document such as the loaded event of an element or the click event of a button. In the following example of such a method, ShopOperator is a subclass of XamlDataObject and the getalloperators method is a webserverexecution method. cmblogonuser_loaded(control: XamlComboBox input; originalsource: XamlObject input) browserexecution, updating; vars operators : StringArray; shop : ShopOperator; begin create shop transient; operators := shop.getalloperators(); cmblogonuser.itemssource := operators; epilog delete shop; end; 7. When IIS receives the request, it passes it to JadeHttp, which in turn passes the message to a copy of the JADE application, using the rules defined for Web services. 8. When the JADE application receives the request, it automatically creates a transient copy of the object that is the receiver of the method to be called and any object parameters (and recursively, any references defined on those objects). 9. The JADE application then calls the requested method on the created object. That method performs the JADE logic associated with that action. For example: getalloperators(): StringArray webserverexecution; vars client : Client; company : Company; result : StringArray; begin company := Company.firstInstance; if company <> null then create result transient; foreach client in company.allclients do result.add(client.name); endforeach; endif; return result; end; 10. When the method completes, the updated contents of the object on which the method was called are passed back to the browser, together with any parameters that were usage IO or output and the method s return value data.

22 Chapter 1 Introduction to JADE XAML 22 All transient objects created automatically in the JADE client are then deleted. It is your responsibility to ensure that any other transient objects created during the execution of the JADE logic are also deleted. 11. When the reply is received in the browser logic, the objects passed back are updated and the current method logic then continues its execution. Defining the WebSession Class If Web session handling is not enabled, currentsession will be null in JADE logic. If Web session handling is enabled, a unique instance of the schema WebSession subclass is created for each user and currentsession is set to that instance before the requested webserverexecution method is called. JADE logic can use this object to retain some state information for each user. To enable Web session handling, use the JadeMonitorSchema schema JadeWebConfigurator application to build the HTML file that defines the Web environment values. For details about configuring a Web application, see Chapter 3 of the JADE Web Application Guide. Use of this file overrides application-defined parameters. In particular, ensure that the application/web_ config/web_services_provider/use_session_handling option is set to true. Set the ApplicationConfigFile parameter value in the [WebOptions] section of the JADE initialization file to the file being used; for example: [WebOptions] ApplicationConfigFile=G:\JADE\SilverlightBasic\SilverlightStatelessConfig.xml A sample configuration is as follows. <?xml version="1.0"?> <JADE_config> </application> <application schema="silverlightbasic" name="silverlightbasic" id=""> <web_config> <connection_name>localhost:20010</connection_name> <application_copies>5</application_copies> <session_timeout>10</session_timeout> <minimum_response_time>0</minimum_response_time> <disable_messages>false</disable_messages> <output_maximum_length>0</output_maximum_length> <log_file_name>c:\temp\webactivity.log</log_file_name> <disable_logging>false</disable_logging> <lock_retries>1</lock_retries> <prompt_on_shutdown>true</prompt_on_shutdown> <firewall>false</firewall> <monitor_font/> <base_uri> <protocol>http</protocol> <machine_name>localhost</machine_name> <virtual_directory>jade</virtual_directory> </base_uri> <support_library/> <JADE_forms> <physical_directory/> <maximum_html_size/> <scrolling_text/> <show_modal/>

23 Chapter 1 Introduction to JADE XAML 23 <cross_browser/> <form_style/> <use_html4/> <web_events> <control_name/> </web_events> <image_type/> <page_sequencing/> </JADE_forms> <html_documents> <home_page/> <html_page_sequencing/> </html_documents> <web_services_provider> <read_timeout>0</read_timeout> <use_session_handling>true</use_session_handling> <use_document_parser>false</use_document_parser> <minimum_in_use>1</minimum_in_use> <maximum_in_use>1</maximum_in_use> <queue_depth_limit>0</queue_depth_limit> <queue_depth_limit_timeout>0</queue_depth_limit_timeout> <worker_idle_timeout>0</worker_idle_timeout> </web_services_provider> </web_config> </application> </JADE_config> Note The WebSession object for each user is a persistent object that can be updated only in transaction state. Defining the IIS Environment Define the IIS environment as you would for a Web service application. This includes the requirement that the jadehttp.ini file contains the definition required for this application, as shown in the following example. [SilverlightStatelessApp] ApplicationType=WebServices TcpConnection=localhost TcpPort=20010 connectiongroup= MinInuse=1 MaxInuse=15 CloseDelay=10 MaxMessageSize= MinMessageSize=5 MessageTimeout=300 VirtualDirectory= MaxQueueDepth=0 GroupSharesConnections=false Generating the XAP and HTML Files for a Silverlight Stateless Application You must create a Silverlight Stateless, Non-GUI or a Silverlight Stateless, Gui application type for your schema before you can generate the XAP and HTML files for that application. For details, see "Defining a Silverlight Application", earlier in this chapter.

24 Chapter 1 Introduction to JADE XAML 24 The generate (XAP build) process uses the following information. 1. The JADE application definition. 2. The names that you supplied for the XAP and HTML files. By default, these are taken from the application name. 3. The output directory that you specified, which defines where the generated XAP and HTML files are placed at the end of a successful build. This directory name is retained in the [JadeSilverlight] section of the JADE initialization file. Generate the XAP and HTML files for your Silverlight stateless application in the following ways. Using the jadclient command line (for details, see "Running a Non-GUI Client Application using jadclient", in Chapter 1 of the JADE Runtime Application Guide) From the JADE development environment You must regenerate and redeploy the files each time you make changes to the presentation layout and logic of the Silverlight stateless application. For details about generating the XAP and HTML from the JADE development environment in the XAML Browser, see "Generating XAP and HTML Files", in Chapter 2. For details about the machine requirements, see "Requirements to Generate XAP and HTML Files", later in this chapter. When using the jadclient command line, run the XapFileBuilder JADE schema application and provide the following parameters (in the specified order). 1. Schema name 2. Application name 3. XAP file name 4. HTML file name 5. Results directory name (the directory name is retained in the [JadeSilverlight] section of the JADE initialization file) 6. Whether the temporary build directory is retained The following is an example of using the jadclient command line to generate the files. jadclient path=c:\mysystem ini=c:\mysystem\jade.ini schema=jadeschema app=xapfilebuilder endjade MySilverlightSchema MySilverlightApplication MySilverlightApp StartupPage c:\website\bin true The generate is performed on the client node (that is, the standard JADE client or the application server, when running in presentation client mode). In Silverlight thin client mode, the XAP file is always built on the application server, in the JADE work directory of that node. However if the build does not complete successfully, the log files are copied to the location specified by the XapBuildLogDirectory parameter in the [JadeSilverlight] section of the JADE initialization file (when running in presentation client mode, the JADE initialization file is located on the presentation client and the log files are therefore copied to a location relative to the presentation client). If the value of this parameter is <default> or it is not specified, any log files are copied to the JADE logs directory on the application server. The number of files that is output depends on the phases of the XAP build process that have completed.

25 Chapter 1 Introduction to JADE XAML 25 By default, the build directory is deleted if the generate completes successfully. You can configure the XAP file generate process to retain the build directory, by checking the Retain XAP build directory check box on the XAP File Generator dialog or by specifying true as the last parameter in the jadclient command line. When the XAP file generate process is configured to retain the build directory and the build fails, the build files are copied back to the presentation client (into the location specified by the JadeWorkDirectory parameter on the [JadeEnvironment] section of the JADE initialization file on the presentation client). The files on the application server are still deleted. The name of the retained directory has the following format. JadXAPBuild_user-code_timestamp If you want the retained directory to be written to a constant unique directory, specify UniqueXapBuildDirectory=false in the [JadeSilverlight] section of the JADE initialization file on the presentation client. This excludes the timestamp portion of the file name. However, any contents in any existing directory are overwritten. Generation Steps After starting, the XAP file generate process: 1. Extracts browserexecution methods and class definitions. 2. Generates C# code and project files for extracted methods and classes. 3. Runs the Microsoft build process over the code generated in the previous step, to build the XAP file. 4. Generates an HTML page to launch the application. 5. Copies the XAP and HTML files to the specified location, and deletes all work files and directories, if configured to do so. As each step is performed, status messages are recorded in various log files. If the generate is successful, these files (which reside in the temporary directory created for the generate) are removed on completion of the build process. If the build fails, the entire temporary directory is retained. A failure is also recorded in the JADE message log (that is, jommsgn.log file). If the build fails, the location of the temporary directory and the XAPbuild.log is reported in a dialog when you run the generate process in the JADE development environment. It is also recorded in the JADE message log, which is useful if you run the generate process from the jadclient program. The XAPbuild.log file lists the steps being performed and whether they were successful. If a step fails, this log file may refer to another log, which may contain more-specific details. When you run the XapFileBuilder application from the jadclient program and the generation fails, the exit code returned is 1; successful generation returns zero (0). Reasons for failure include: Invalid arguments in the XAP build process When a JADE method has not been compiled When a JADE method is in error When a syntax error occurs in the generated C# compile

26 Chapter 1 Introduction to JADE XAML 26 Requirements to Generate XAP and HTML Files The XAP and HTML files are generated on the client node (on the application server when running in thin client mode). The machine on which the client node is running requires the following.net and Silverlight software to generate the XAP and HTML files used by Silverlight stateless applications. Microsoft Visual Web Developer 2010 Express, which you can obtain from You can install Microsoft Visual Studio 2010 Professional instead of Microsoft Visual Web Developer 2010 Express. (Microsoft SQL Server is not required to be installed.) Microsoft Silverlight 4 Tools for Visual Studio 2010, which you can obtain from Debugging a Silverlight Stateless Application To examine the processing of requests received from the browser in the JADE debugger, initiate the application from the Run Application dialog in the JADE development environment and check the Activate Debugger check box. Note In some browsers (for example, Mozilla and Chrome) some events occur asynchronously and may be directed to application copies that are not being debugged. To avoid this situation, specify 1 in the Application Copies text box on the Web Options sheet of the Define Application dialog and specify >1 in the MaxInUse parameter in the jadehttp.ini file. To debug the presentation client logic, you must create another application definition that is of Silverlight presentation client style. This requires use of an application server to run the application. Initiate this application from the Run Application dialog in the JADE development environment and check the Activate Debugger check box. Under this debugging mode, JADE will create a WebSession object to cover the case where Web session handling is enabled. Debugging in this mode may not be entirely identical to running without debugging, because asynchronous events do not occur, the application mode will be stateful, and the thin client logic for processing GUI properties and methods is different from that used in the stateless mode. Handling Exceptions in a Silverlight Stateless Application By default, JADE logic exceptions in the JADE client are caught by an internal global exception handler and logged as normal. No exception dialog is displayed. The failure is also reported back to the browser client and displayed in the default exception dialog. Your application could install its own global exception handler, if required. Exceptions that occur in the Silverlight presentation logic running in the browser are displayed to the user, by default. This presentation includes: The name of the method in which the exception occurred. The type of the exception that occurred. The text of the error message. The stack trace of the logic exception. A button that allows the user to copy the information to the clipboard.

27 Chapter 1 Introduction to JADE XAML 27 A button that allows the user to return to the page on which the error occurred and to try again or to perform some other option. JADE enables you to process the exception by re-implementing the Application class handlesilverlightexception method (for Silverlight stateless applications), as follows. app.handlesilverlightexception(errornumber: Integer; methodname: String; exceptiontype: String; error: String; stacktrace: String): Boolean; The parameters in this method are listed in the following table. Parameter errornumber methodname exceptiontype error stacktrace Description Error number, if known. This will be non-zero for known situations only; for example, array index out of bounds. Name of the method in which the exception occurred. For security reasons, Silverlight does not let logic access the line and column number where the exception occurred. Name of the exception type (which can be null). Error message text. Execution method stack at the time of the exception. This can be null if the exception was associated with the inability to connect to the application via IIS. A return value of true prevents the default exception dialog being displayed. A return value of false displays the default exception dialog. JADE Silverlight Stateful Thin Client Applications A normal HTML page is used to host the Silverlight control. Inside an HTML page is an <object> tag with various information about the Silverlight application being referenced. Microsoft recommends that some other HTML tags and JavaScript routines are present in this HTML file. On request, JADE automatically generates a skeleton HTML file with the user Silverlight application embedded that conforms to these requirements. You can then extend or alter this HTML file, to meet the requirements of your Web site. By default, the Silverlight application encompasses the entirety of the page; however, it may be confined to any arbitrary region of the page. A Microsoft Silverlight application has the.xap suffix (XAML Application). The JADE Silverlight thin client is contained in the file JadeAgl.xap. Your HTML files should therefore reference this file. This application acts as the JADE thin client, communicating with the JADE application server and running the user JADE application. The architecture is similar to the traditional thin client, but rather than the normal use of jade.exe as a thin client, JadeAgl.xap runs inside the browser and acts as the thin client. For details about using third-party controls in a Silverlight stateful application, see "Third-Party Control Usage in JADE Silverlight Stateful Applications", in Chapter 4. Deploying a JADE Silverlight Stateful Thin Client Application The deployment of a JADE Silverlight presentation client application is similar to an application that is based on a system with an application server and classical presentation clients. As in these systems, the Silverlight presentation client is connected to the application server via TCP. This connection is retained until the application terminates.

28 Chapter 1 Introduction to JADE XAML 28 The difference with a Silverlight application is that there is no need for a JADE installation at the presentation client end. The presentation client is the JadeAGL Silverlight application and does not need a JADE system installed to run. The JadeAgl.xap file must be visible to the browser environments. This XAP file must match the version running in the application server. Silverlight as a plug-in handles version changes and ensures that the latest JadeAGL version is present at the browser end. To deploy your XAML application, copy the HTML file and JadeAgl.xap file to the Web server, as well as any image and media files used by the application. Within the Silverlight section of the HTML file is an automatically generated line; for example: <param name="initparams" value="app=simplexamlshopschema, Schema=SimpleXamlShopSchema, AppServer=appserver.jadeworld.com, AppServerPort=4531"/> You can alter these settings, depending on the location of your application server. These settings are read by JadeAgl.xap when the application starts up and used during initial contact of the JADE application server. Because of a security restriction imposed by Microsoft, whenever a Silverlight user application attempts to open a TCP connection back to the Web server, the system must first confirm that the Web server has given permission for this. The Web server must therefore have a Silverlight Policy Server running that gives the appropriate permissions. The policy server must listen for incoming connections on port 943 and respond to a policy request, by replying with the appropriate XML policy permissions file. JADE provides you with the App=SilverlightPolicyServer, Schema=JadeSchema policy server. This is a non- GUI application that you can run by using a standard JADE shortcut or you can execute it automatically when the application server starts up, by using the JADE initialization file syntax for the initiation of non-gui applications. (This policy server is used automatically when running a Silverlight application within the JADE development environment.) For details, see "Running a Non-GUI Client Application using jadclient", in Chapter 1 of the JADE Runtime Application Guide, the Application class startapplication, startapplicationwithparameter, or startappmethod method in Chapter 1 of the JADE Encyclopaedia of Classes, or the ServerApplication parameter in the [JadeServer], [JadeAppServer], or [NonGuiClient] section of the JADE Initialization File. Alternatively, JADE provides example C# source code, derived from a Microsoft example, which you can use to run a simple C# policy server on your Web server. If there is no policy server running on your Web server, the JADE Silverlight presentation client will fail to connect to the application server because Silverlight will deny it access. Running a JADE Silverlight Stateful Application Running a JADE Silverlight presentation client application is very similar to running an application that is based on a system with an application server and classical presentation clients. Use the Run Application button from the Browser toolbar to run a JADE Silverlight presentation client application. The Run Application dialog is then displayed. For details, see "Running an Application from the JADE Development Environment", in Chapter 1 of the JADE Runtime Application Guide.

29 Chapter 2 Using the XAML Browser This chapter covers the following topics. Accessing the XAML Browser Navigating around the XAML Browser Using the XAML Menu Using Function Keys and Shortcut Keys Using Browser Shortcut Keys Adding a New Document Searching for a Document Editing an Existing Document Deleting a Document Renaming a Document Refreshing the View Maintaining Properties for Your Document Saving Your Document Comparing the XAML Changes in Parent and Sub-documents Saving Your Document as another Name Generating XAP and HTML Files Selecting the XAML Browser Mode Hiding or Showing the Toolbar Accessing the XAML Browser Use the XAML Browser to: Navigate through the XAML documents in your schema View the actual XAML or a preview of the document layout Activate the XAML Painter (for details, see "Accessing the XAML Painter", in Chapter 3) You can start multiple copies of the XAML Browser, which can run in parallel with one or more copies of the XAML Painter. Note The XAML Browser can be run from a standard or presentation client. However, you cannot toggle to the Paint mode if you are running a standard client.

30 Chapter 2 Using the XAML Browser 30 To access the XAML Browser 1. Select the XAML Browser command from the File menu of a standard browser window. The XAML Browser is then displayed. When you first access the XAML Browser, no document is selected so there is no XAML to display. The name of the schema whose XAML documents you are browsing is displayed in the title bar of the XAML Browser, as shown in the following diagram. The Navigator pane at the left of the XAML Browser provides a Class Browser that displays only XamlDocument subclasses. The pane at the right of the XAML Browser displays the XAML or a preview of the selected document. 2. If you want to preview or display the XAML of an existing document in the schema, select the document in the Navigator pane at the left of the XAML Browser. Alternatively, use the Find Document dialog to search for an existing document (for details, see "Searching for a Document", later in this chapter). Click the plus sign (+) at the left of a document in the Navigator pane, to display its sub-documents. To collapse the display of the sub-documents for a document, click on the minus sign (-).

31 Chapter 2 Using the XAML Browser 31 XAML for the selected document is displayed, as shown in the following diagram. The XAML sheet, in the pane at right of the XAML Browser, is displayed by default and displays the XAML of the XamlDocument subclass selected in the Navigator pane. Note The colors used for elements, attributes, and attribute value on the XAML sheet are JADE default colors and you cannot change them. 3. To collapse the display of an element, click on a minus sign (-) in the second column. That element, including its closing tag row, is then hidden and a plus sign (+) is displayed in the second column to indicate a hidden element. 4. Edit the XAML on this sheet, if required. For details, see "Editing an Existing Document", later in this document. We recommend that you use the XAML Painter to add and define the User Interface (UI) elements on your document. For details, see Chapter 3, "Painting XAML Documents".

32 Chapter 2 Using the XAML Browser To preview the page of a document subclass, select the Preview tab. The document is then previewed in the pane at the right of the XAML Browser, as shown in the following diagram. 6. To clear the preview or display of the XAML of the selected document in the schema, click the Clear button in the Navigator pane at the left of the XAML Browser. The document is no longer selected in the Navigator pane and the XAML and Preview sheets are cleared. This does not delete the document. 7. To close the XAML Browser, click the close icon at the upper-right of the XAML Browser. For details about accessing the XAML Painter if you are running a presentation client, see "Accessing the XAML Painter", in Chapter 3. Navigating around the XAML Browser Use XAML Browser toolbar buttons to: Quickly access commonly used functions Switch between the Navigate and Paint modes The toolbar buttons are a point-and-click alternative to other XAML menu actions; for example, the New or Refresh command. For details, see "Using the XAML Menu", in the following section.

33 Chapter 2 Using the XAML Browser 33 Note The toolbar is displayed, by default. To hide the toolbar display (for example, if you want to maximize the area for XAML, preview, or painter area), click the close icon at the upper right corner of the toolbar or select the Hide Toolbar command from the XAML menu. To display the toolbar when it has been hidden, select the Show Toolbar command from the XAML menu. The radio buttons on the toolbar enable you to specify the mode in which the XAML Browser operates. Examples of the default Navigate mode are shown in the previous section; that is, "Accessing the XAML Browser". In the Paint mode, the Navigator pane and the pane at the right of the XAML Browser pane are replaced by an instance of the XAML Painter. (In Paint mode, the XAML Browser toolbar is displayed.) For details about the XAML Painter, see "Accessing the XAML Painter", in Chapter 3. For details about selecting the Paint or Navigator mode, see "Selecting the XAML Browser Mode", later in this chapter. Because the XAML Painter is a Silverlight application that can be run only from a presentation client, the Paint mode is disabled when you are not running as a presentation client. When the XAML Browser is active, the XAML menu specific to the XAML Browser is displayed in the JADE development environment, to enable you to change the mode of operation and to recover a hidden toolbar, for example. Using the XAML Menu The XAML menu enables you to perform XAML functions from within the XAML Browser or XAML Painter. The XAML menu commands are listed in the following table, with their toolbar buttons, where applicable, and a reference to the subsections that provide more details. Button Command Description For details, see New Opens the New XAML Document dialog Adding a New Document Edit Displays the Edit XAML Document dialog Editing an Existing Document Delete Cuts (logically deletes) the document Deleting a Document Rename Renames a document Renaming a Document Find Document Opens the Find Document dialog Searching for a Document Refresh Undoes all changes since the document was last saved and refreshes the view Refreshing the View Properties Accesses the Properties dialog Maintaining Properties for Your Document Save Saves the current document Saving Your Document Save As Saves your document as another name Saving Your Document as another Name Generate XAP Generates the XAP and HTML files of the Silverlight stateless application Generating the XAP and HTML Files for a Silverlight Stateless Application

34 Chapter 2 Using the XAML Browser 34 Button Command Description For details, see Mode Selects the Navigate or Paint mode Selecting the XAML Browser Mode Hide Show Toolbar Toggles the display of the toolbar Hiding or Showing the Toolbar Using Function Keys and Shortcut Keys You can use the keyboard to perform functions to the XAML on the XAML sheet in the pane at the right of the XAML Browser. The keyboard shortcut commands on the XAML sheet follow standard conventions. Press: F1, to display online help for the item with input focus. F4, to display the Find Document dialog. Using Browser Shortcut Keys Use shortcut keys to quickly perform actions on the XAML sheet of the XAML Browser. Caret Movement Shortcut Keys The shortcut keys listed in the following table enable you to perform caret movement functions on the XAML sheet by using the keyboard. Key CTRL+ CTRL+ CTRL+ CTRL+ CTRL+[ CTRL+] CTRL+/ CTRL+\ CTRL+ENTER PAGE UP PAGE DOWN Moves the caret One character to the left. When text is selected, moves the caret to the left of the selected text (that is, it falls off the left). One character to the right. When text is selected, moves the caret to the right of the selected text (that is, it falls off the right). To the beginning of the word (delimited by white space and an alphanumeric or a non-alphanumeric character) on the left. To the beginning of the word (delimited by white space and an alphanumeric or a non-alphanumeric character) on the right. Up one line. Down one line. Scrolls down the text displayed on the XAML sheet by one line. Scrolls up the text displayed on the XAML sheet by one line. To the top of code on the XAML sheet; that is, to the <UserControl> element. To the bottom of the code on the XAML sheet; that is, to the </UserControl> element. To the previous word part (press SHIFT to extend the selection). To the next word part (press SHIFT to extend the selection). To a newly inserted line without performing automatic indenting. Up one screen. Down one screen.

35 Chapter 2 Using the XAML Browser 35 Key HOME END ALT+HOME ALT+END CTRL+HOME CTRL+END Moves the caret To the first non-white space character on the current line if the caret is not already positioned there. To the end of the current line. To the start of the display line (that is, to the first character on the current line). To the end of the display line. To the beginning of the text on the XAML sheet. To the end of the text on the XAML sheet. Extending Selected Blocks Shortcut Keys The shortcut keys listed in the following table enable you to extend selected blocks on the XAML sheet. Key Combinations CTRL+SHIFT+END CTRL+SHIFT+HOME SHIFT+ or ALT+SHIFT+ SHIFT+ or ALT+SHIFT+ SHIFT+END or ALT+SHIFT+END SHIFT+HOME or ALT+SHIFT+HOME SHIFT+ or ALT+SHIFT+ SHIFT+ or ALT+SHIFT+ SHIFT+PAGE DOWN SHIFT+PAGE UP SHIFT+CTRL+ SHIFT+CTRL+ Action Extends selection to end of text on the XAML sheet. Extends selection to start of text on the XAML sheet. Reduces the selected block one character to the left. Extends the selected block one character to the right. Extends the selected block to the end of the current line. Extends the selected block from the caret to start of text within the current line or extends the selection to the start of the line when pressed again (for example, to the start of any whitespace). Extends the selected block to the same column in the next line. Extends the selected block to the same column in the previous line. Extends the selected block down one screen. Extends the selected block up one screen. Moves (extends) the selected block left one word of the caret position. Moves (extends) the selected block right one word of the caret position. Insert and Delete Shortcut Keys The shortcut keys listed in the following table enable you to perform insert and delete functions in the XAML sheet by using the keyboard. Key BACKSPACE DELETE CTRL+BACKSPACE Action Deletes the character to the left of the caret. Deletes the character to the right of the caret. Deletes the word to the left of the caret, and deletes the word to the left of selected text if text is currently selected.

36 Chapter 2 Using the XAML Browser 36 Key CTRL+DELETE CTRL+INSERT or CTRL+C CTRL+SHIFT+BACKSPACE CTRL+SHIFT+DELETE INSERT SHIFT+DELETEor CTRL+X SHIFT+INSERTor CTRL+V Action Deletes the word to the right of the caret, and deletes the word to the right of selected text if text is currently selected. Copies the selected portion of the text to the clipboard. Deletes to start of line. Deletes to end of line. Toggles the insert mode on or off. Cuts (logically deletes) selected text, and copies it to the clipboard. Pastes a portion of text from the clipboard to the current position. Using the Mouse within the XAML Sheet The mouse actions that you can perform in the text area of the XAML sheet are listed in the following table. Mouse Action Left-click Double-click Triple-click Left down and move SHIFT+left-click ALT+left down and move Result Moves the caret to the cursor location and cancels the selection. Selects the word at the cursor location. Selects the line at the cursor location. Anchors the selection at the down position and extends to follow the cursor location. Moves the caret to the cursor location and extends the selection to the new location. Anchors a rectangular selection at the down position and extends to follow the cursor location. Using the Mouse within the Line Number Margin The mouse actions that you can perform within the line number margin of the XAML sheet are listed in the following table. Mouse Action Left-click CTRL+left-click SHIFT+left-click Result Selects the line at the cursor location. Selects all text in the editor pane. Extends the line-based selection from the current anchor point to the line at the cursor location. Adding a New Document Use a document to create an interface for your JADE XAML applications. A document is a window on which you paint controls (UI elements) for the running of your application. You also use a document to define a print layout. You can create XAML documents (pages) only in the XAML Browser or XAML Painter.

37 Chapter 2 Using the XAML Browser 37 A document can be a subclass only of another user-defined document class or of the XamlDocument system class. Existing documents are displayed in the Navigator pane at the left of the XAML Browser, to enable you to select the document that is to be subclassed. A sub-document inherits all of the methods and properties of its parent, or super-document. All documents are subclasses of the XamlDocument class. When you add the first document to your schema, it is automatically created as a subclass of the XamlDocument system class (superclass), inherited from the RootSchema. When you define an application for the schema, specify the XAML document that is to be displayed on start up, in the Startup XAML combo box on the Define Application dialog; that is, the document that is initially created and displayed automatically when the application is started up. For details, see "Specifying a Silverlight Application", in Chapter 1. When you add subsequent documents, they are added as a subclass of the document that is currently selected in the Navigator pane. If you do not want to add a document as a subclass of the currently selected document, click the Clear button to deselect it. The Navigator pane is then cleared of its current selection and the XAML and Preview sheets are also cleared. To add a new document 1. Perform one of the following actions. Click the New Document toolbar button. Select the New command from the XAML menu. Right-click in the Navigator pane and then select the New command from the popup menu that is displayed. The New XAML Document dialog, shown in the following diagram, is then displayed, to enable you to define your new document. 2. Specify a document name in the Name text box. You must specify a document name, which cannot have the same name as: Another document in the schema An application name within the current schema Another class in the current schema (or any of its superschemas) Predefined JADE classes or interfaces

38 Chapter 2 Using the XAML Browser 38 The document name must start with a letter, and can be a maximum of 30 characters. It can include numbers and underscore characters, but cannot include punctuation or spaces. As documents are defined in the JADE database as classes, the first letter of the name is converted to an uppercase character, if it is lowercase. 3. If you want the document to be a subclass of another document in the schema, select the superclass in the Subclass of combo box. The document inherits the style of the selected superclass and the Style combo box is then disabled. 4. If the document is not a subclass of another document, select the appropriate style in the Style combo box. The Subclass of combo box is then disabled. The document style can be one of the following. Grid-based, sizable and scrollable Grid-based, of a fixed size and scrollable Grid-based, of a fixed size Canvas-based, of a fixed size and scrollable Canvas-based, of a fixed size Child window, of a fixed size Popup window of a fixed size Tip Position your cursor in the Style combo box, to view the default XAML that is associated with the selected style. 5. Click the OK button. Alternatively, click the Cancel button to abandon your selections. The XAML Browser then displays the new document in Paint mode. For details, see Chapter 3, "Painting XAML Documents". Searching for a Document Use the Find Document dialog to search for an existing XAML document and then open it in the XAML Browser. To search for an existing document, perform one of the following actions Select the Find Document command from the XAML menu. Press F4.

39 Chapter 2 Using the XAML Browser 39 The Find Document dialog, shown in the following diagram, is then displayed to enable you to specify the name of the document that you want to open. The Select Required Entry list box displays the XAML documents defined for the currently selected schema. To open an existing document 1. In the Find text box, enter the name of the document that you want to find. As you enter the name, the document that matches your entry is highlighted in the Select Required Entry list box. Alternatively, if the document is displayed in the Select Required Entry list box, select it. 2. Click the OK button. Alternatively, click the Cancel button to abandon your selection. The selected document is then opened in the XAML Browser. Editing an Existing Document Edit an existing document in the XAML Browser or in the XAML Painter. You can edit an existing XAML document only in the XAML Painter if it is not already open for editing (for example, previewed in the XAML Browser). However, you can edit the XAML of an existing document on the XAML sheet of the XAML Browser in Paint mode, or on the XAML View sheet of the XAML Browser in Paint mode, and then select the Save command in the XAML menu to save your changes. When you edit a document in the XAML sheet, the Edit menu is available so that you can edit the XAML that is currently displayed (for details, see "Using the Edit Menu", in the following subsection). Note Use the Find Document dialog to search for an existing XAML document and then open it in the XAML Browser. For details, see "Searching for a Document", earlier in this chapter. If you do not save your changes before selecting another document in the Navigator pane, you are prompted to confirm that you want to discard your changes. Click the Yes button to save the current changes and view the selected document, or click the No button to discard the current changes and view the selected document. Alternatively, click the Cancel button, to return to the XAML sheet and save your changes.

40 Chapter 2 Using the XAML Browser 40 To edit an existing XAML document, perform one of the following actions Select the Edit command in the XAML menu of the XAML Painter and then use the Edit Xaml Document dialog to specify the document that you want to edit. For details, see "Editing an Existing Document in the XAML Painter", in Chapter 3. Select a XamlDocument subclass in the Class List of the Class Browser and then perform one of the following actions. Select the Edit XAML Document command from the Classes menu. Right-click on the XAML document and then select the Edit XAML Document command from the popup menu that is displayed. Right-click on the Painter toolbar button. This functionality is disabled if the selected class is not a XamlDocument subclass. The XAML Painter displays the document as you edit it. You can select displayed named items and use the mouse to manipulate them. For details, see "Creating a New XAML Document", in Chapter 3. Using the Edit Menu The Edit menu is displayed in the XAML Browser only in the XAML sheet, to enable you to edit the XAML that is currently displayed. The Edit menu commands, described in the following subsections, are listed in the following table. Command Shortcut Key Description Undo ALT+BKSP or CTRL+Z Undoes the last action Redo CTRL+Y Reverses the last action that was undone Cut CTRL+X Cuts a selected portion of text and copies it to the clipboard Copy CTRL+C Copies a selected portion of text to the clipboard Paste CTRL+V Pastes a portion of text from the clipboard to the current caret position Select All CTRL+A Selects all of the text displayed in the XAML sheet Find/Replace SHIFT+F3 Locates the specified text in the XAML sheet and optionally replaces that text occurrence Find Again F3 Locates the next occurrence of the specified text Find At Caret CTRL+F3 Locates the next occurrence of the text on which the caret is positioned Edit menu commands that are not available for selection are disabled. For example, if you have not selected any text in the XAML sheet, the Cut and Copy commands are disabled, and cannot be selected. Undo Command Use the Undo command to undo the last action in the XAML sheet, if required, or you can perform multiple undo operations.

41 Chapter 2 Using the XAML Browser 41 To undo your last action, perform one of the following actions Select the Undo command from the Edit menu Right-click in the XAML sheet and then select the Undo command from the menu that is displayed Press CTRL+Z Press ALT+BKSP The last action (for example, a keystroke) that you performed in the XAML sheet is then undone. This command is disabled when there is no action that can be undone. Redo Command Use the Redo command to reverse the last action that was undone. You can repeat the Redo command to step forward and redo actions that were previously undone. To redo the last action undone, perform one of the following actions Select the Redo command from the Edit menu Right-click in the XAML sheet and then select the Redo command from the menu that is displayed Press CTRL+Y Your previously undone action is then redone. Cut Command Use the Cut command to cut a selected portion of text from the XAML sheet to the clipboard, if required. To cut selected text, perform one of the following actions Select the Cut command from the Edit menu Right-click in the XAML sheet and then select the Cut command from the menu that is displayed Press CTRL+X The selected text is then cut (logically deleted) from the XAML sheet and moved to the clipboard. This command is disabled when there is no text selected in the XAML sheet. Copy Command Use the Copy command to copy text selected in the XAML sheet to the clipboard, if required. This text can then be pasted at another position in the XAML sheet or in a text editor such as Notepad. To copy selected text to the clipboard, perform one of the following actions Select the Copy command from the Edit menu Right-click in the XAML sheet and then select the Copy command from the menu that is displayed Press CTRL+C The selected text is then copied to the clipboard. This command is disabled when there is no text selected in the XAML sheet.

42 Chapter 2 Using the XAML Browser 42 Paste Command Use the Paste command to paste text from the clipboard into the XAML sheet, if required. The pasted text can be a selection that was copied or cut from the XAML sheet. To paste text at the current caret position, perform one of the following actions Select the Paste command from the Edit menu Right-click in the XAML sheet and then select the Paste command from the menu that is displayed Press CTRL+V The selected text is then copied from the clipboard, starting at the current caret position. This command is disabled when there is no text in the clipboard. Select All Command Use the Select All command to select all of the text that is displayed in the XAML sheet. You can then select the Copy command to copy the selected text to the clipboard. To select all of the text on the XAML sheet, perform one of the following actions Select the Select All command from the Edit menu Right-click in the XAML sheet and then select the Select All command from the menu that is displayed Press CTRL+A All of the text in the XAML sheet is then selected. Find/Replace Command Use the Find/Replace command to locate text in the XAML sheet and optionally replace the located text with a specified value. To locate and optionally replace text in the XAML sheet 1. Perform one of the following actions. Select the Find/Replace command from the Edit menu Right-click in the XAML sheet and then select the Find/Replace command from the menu that is displayed Press SHIFT+F3

43 Chapter 2 Using the XAML Browser 43 The Find/Replace dialog, shown in the following diagram, is then displayed. 2. In the Search Text text box, specify the text that you want to locate in the XAML sheet. 3. In the Replace Text text box, specify the text that is to replace the specified text that is found, if required. 4. If you want an exact match by case (where uppercase and lowercase is significant), check the Case Sensitive check box. A search is then performed for text with the same capitalization as the text in the Search Text text box. By default, searching is case-insensitive; that is, this check box is unchecked. You can optionally replace text that is located and matched by case with text with the same capitalization as the text specified in the Replace Text text box. 5. If you want to confirm that each occurrence of the specified search text is replaced with the specified replacement text, check the Prompt on Replace check box. By default, you are not prompted to confirm text replacement; that is, this check box is unchecked. When you select text replacement confirmation and you click the Replace All button, the Verify Replace dialog is displayed every time the search text is located. In the Verify Replace dialog, perform one of the following actions. Click the Yes button to confirm that the located text is to be replaced. Click the No button to leave the highlighted text unchanged and continue searching for the specified text. Click the Cancel button to abandon the search and return focus to the XAML sheet. 6. If you want to search backwards through the contents of the XAML sheet from the current caret position up to the beginning of the XAML sheet, check the Search Backwards check box. The Search Backwards check box is enabled only when you select the Caret option button in the Start From group box. By default, searching is performed from the current caret position to the end of the XAML sheet; that is, this check box is unchecked. When this option is checked, you have specified your search and replacement text, and you click the Replace All button, the Verify Replace dialog is displayed every time the search text is located. 7. If you want the search to start from a specific position in the XAML sheet, select the Caret option button in the Start From Group box. The Search Backwards check box is then enabled. By default, the Top option button is selected, indicating that the search begins at the top of the sheet. 8. To find the next occurrence of the specified text, click the Find button.

44 Chapter 2 Using the XAML Browser 44 If JADE finds the text that matches your specified options, the located text is then highlighted and focus is returned to the XAML sheet. If JADE cannot find the text that matches your specified options, a message dialog informs you that the search text was not found and waits for you to click the OK button in the message dialog before returning focus to the XAML sheet. 9. To replace all occurrences of the specified text in the Search Text text box with the text specified in the Replace Text text box, click the Replace All button. If JADE finds the text that matches your specified options, all occurrences of the located text are then replaced with the specified replacement text and focus is returned to the XAML sheet. If you checked the Prompt on Replace check box, you are prompted to confirm that each occurrence of the located text is to be replaced. 10. Click the Cancel button to abandon your selection. Find Again Command When the text specified in the Find/Replace dialog has been located and focus returned to the XAML sheet, you can make further searches for that text. To find the next occurrence of specified text, perform one of the following actions Select the Find Again command from the Edit menu Right-click in the XAML sheet and then select the Find Again command from the menu that is displayed Press F3 The next occurrence of that text is then located and highlighted or the Message dialog is displayed, advising you that the search text was not found if no further occurrences of that text are located. Find At Caret Command Use the Find At Caret command to locate the next occurrence of the text on which the caret is positioned in the XAML sheet. To locate text on which the caret is positioned, perform one of the following actions Select the Find At Caret command from the Edit menu Right-click in the XAML sheet and then select the Find At Caret command from the menu that is displayed Press CTRL+F3 The next occurrence of that text in the XAML sheet is then highlighted. Deleting a Document To delete a document 1. To delete the document selected in the Navigation pane of the XAML Browser or displayed in the XAML Painter, perform one of the following actions. Click the Delete Document toolbar button. Select the Delete command from the XAML menu.

45 Chapter 2 Using the XAML Browser 45 Right-click on the document in the Navigator pane and then select the Delete command from the popup menu that is displayed. A message box is then displayed, prompting you to confirm that you want to delete the selected document. 2. Click the Yes button to delete the document. Alternatively, click the No button to abandon the deletion. Notes You cannot delete a document if the document has subclasses, any existing property references, or the document is open in the XAML Browser or XAML Painter. When you delete a document, the corresponding class and all its methods are deleted. Any methods referencing the deleted document are flagged as uncompiled. Renaming a Document You can change the name of an existing document in the current schema. To rename the currently selected document 1. Perform one of the following actions. Select the Rename command from the XAML menu. Right-click on the document in the Navigator pane and then select the Rename command from the popup menu that is displayed. The Rename of Schema-name::Document-name dialog, shown in the following diagram, is then displayed. The current name and subclass of the document are displayed in the Name text box and Subclass of combo box, respectively. You cannot update the subclass of the document. 2. In the Name text box, specify the new name for your document. 3. Click the OK button. Alternatively, click the Cancel button to abandon the operation. When a document is renamed, JADE performs the following actions. Updates the associated XAML. Replaces all references with the new name in all entities that referenced the old document name.

46 Chapter 2 Using the XAML Browser 46 Note The document name replacement may not be successful in methods that are in error. Recompiles all methods with references to the old document name. Refreshing the View You can refresh (update) the contents of the XAML Browser or XAML Painter to discard any changes that you have made since the document was last saved. To discard any changes since the document was last saved, perform one of the following actions Click the Refresh Discard any changes toolbar button. Select the Refresh command from the XAML menu. Right-click on the document in the Navigator pane and then select the Refresh command from the popup menu that is displayed. The browser or painter is then updated and any changes made to the document since you last saved it are discarded. There may be a momentary delay while this updating occurs. Maintaining Properties for Your Document To maintain the properties associated with your document, use the Properties command from the XAML menu. Alternatively, click the Properties toolbar button. Most of the properties have default settings and many property values are set automatically when you manipulate your document or UI elements in the XAML Painter or you use some of the XAML Painter alignment or layout buttons. In the combo box in the JADE Type column, you can select a subclass of that control, if you have defined any; for example, the combo box for a XAML button control lists any JADE XAML button subclasses that are defined. For details about XAML document and UI element properties, see the JADE Encyclopaedia of XAML Classes. To access the Properties dialog for the document selected in the Navigation pane of the XAML Browser, perform one of the following actions Click the Properties toolbar button. Select the Properties command from the XAML menu. Right-click on the document in the Navigator pane and then select the Properties command from the popup menu that is displayed.

47 Chapter 2 Using the XAML Browser 47 The JADE properties for document-name dialog, similar to that shown in the following diagram, is then displayed. Tip Resize the columns in this dialog, by dragging the vertical grid line to the required position. This may be useful, for example, when viewing property names that can be very long. Click the OK button to save any changes. Alternatively, click the Cancel button to close the JADE properties for document-name dialog. Saving Your Document To save your document, perform one of the following actions Click the Save Document toolbar button. Select the Save command from the XAML menu. Right-click on the document in the Navigator pane and then select the Save command from the popup menu that is displayed. Press CTRL+S. For details about saving your document as a different name or style, see "Saving Your Document as another Name", in the following section.

48 Chapter 2 Using the XAML Browser 48 If you select another document to edit, or attempt to close the XAML Browser before you have saved the changes to the current document, the Query Save Changes dialog, shown in the following diagram, is displayed. Click one of the following buttons to save or discard your changes. Click the: Save Errors Yes button, to save the current changes to the document and continue the navigation to the requested action. No button, to discard the current changes to the document and continue the navigation to the requested action. Cancel button, to cancels the navigation and retains all the unsaved changes. When you attempt to save a XAML document JADE validates the XAML. If no errors are found, the document is saved. If JADE finds an error, the appropriate dialog, which contains a description of the error, is displayed. The following subsections describe the save errors that you might encounter (see also, "Comparing the XAML Changes in Parent and Sub-documents", later in this chapter).

49 Chapter 2 Using the XAML Browser 49 Invalid XAML If your document contains invalid XAML, the Jade - XAML save error dialog is displayed, which includes the line number and column number of the error in the XAML, as shown in the following diagram. Click the OK button and then correct the XAML that is in error. The XAML is not saved.

50 Chapter 2 Using the XAML Browser 50 Parsing Errors If JADE cannot parse the XAML, an exception is raised and the Exception dialog displays an error number in addition to the line number and column number of the error in the XAML, as shown in the following diagram. Click the OK button and then correct the XAML that is in error. The XAML is saved. For details about error messages, see the JADE Error Messages and System Messages document. Single Quotes in the XAML You cannot save your document in the XAML Browser if the XAML contains any single quote characters ('). In the XAML Browser, single quote characters are not allowed and must be replaced with the string &apos; so that the XAML remains valid. If you attempt to save a document whose XAML contains single quote characters, the dialog shown in the following diagram is displayed. Click the OK button, replace any single quote characters with &apos; and then ensure that attribute values are enclosed in double-quote characters. The XAML area of the XAML Painter allows you to use single quote characters as they are converted to the string &apos; when you save and then view that document in the XAML Browser.

51 Chapter 2 Using the XAML Browser 51 Comparing the XAML Changes in Parent and Subdocuments The Compare XAML dialog enables you to compare the XAML of a sub-document with the XAML of the parent document. When you edit a sub-document, you cannot change any of the XAML that was inherited from the parent; that is, the position or property values of those UI elements is fixed. For details, see "Document Subclassing", in Chapter 3. If you make any changes to the XAML of a sub-document that affect the parent document, the dialog shown in the following diagram is displayed when you try to save your changes. Click the No button, to return to the XAML Browser or the XAML Painter. Alternatively, click the Yes button, to compare the changed XAML in the sub-document with that of the parent document. The Compare XAML dialog, shown in the following diagram, is then displayed.

52 Chapter 2 Using the XAML Browser 52 The Latest pane (at the left) displays the XAML of the sub-document. The Original pane (at the right) displays the XAML of the parent document (from which the sub-document is derived). In the Latest and Original panes, the corresponding lines of XAML that have invalid changes are highlighted with a green background. As these panes are read-only, you cannot change the XAML in either of them. Use the XAML Browser or the XAML Painter, to change the XAML (for details, see "Editing an Existing Document", earlier in this chapter). Click the Next button to view the next line of the XAML that has been updated and the parent document, if applicable, or the Previous button to highlight the previous line of XAML that has been updated and the parent document. Click the Cancel button, to close the Compare XAML dialog and return to the XAML Browser or XAML Painter. Saving Your Document as another Name Use the Save As command from the XAML menu to save your document as a new document with a different name. Alternatively, if you have started painting a XAML document but have not yet added it, use this command to save your document. To save the currently selected document as a new document 1. Perform one of the following actions. Select the Save As command from the XAML menu. Right-click on the document in the Navigator pane and then select the Save As command from the popup menu that is displayed. The Save Document-name as dialog, shown in the following diagram, is then displayed. 2. In the Name text box, specify the name under which to save the copy of the document. The specified name must be unique in the current schema. As you cannot save your document under a different superclass or schema, the Subclass of combo box is disabled on this dialog. 3. Click the OK button. Alternatively, click the Cancel button to abandon the operation.

53 Chapter 2 Using the XAML Browser 53 Generating XAP and HTML Files Use the Generate XAP command to generate the XAP and HTML files for your Silverlight stateless application. For details about generating the XAP and HTML files by using the jadclient command line, see "Generating the XAP and HTML Files for a Silverlight Stateless Application", in Chapter 1. See also, "Requirements to Generate XAP and HTML Files", in Chapter 1. To generate the XAP and HTML files of your Silverlight stateless application 1. Select the Silverlight stateless application for which you want to generate XAP and HTML files. 2. Select the Generate XAP command from the XAML menu of the XAML Browser. This command is disabled if the selected application is not a Silverlight stateless application type. The XAP File Generator dialog, shown in the following diagram, is then displayed. 3. In the Application combo box, select the application. By default, the Silverlight stateless application is selected. 4. In the XAP File Name text box, specify the name of the XAP file that is to be generated. By default, the XAP file name is the same as the application name. 5. In the Launching HTML File Name text box, specify the name of the HTML file that is to be generated. By default, the HTML file name is the same as the application name. 6. In the Result Directory text box, specify the directory where the XAP and HTML files are placed at the end of a successful build. Specify a directory or path relative to the machine on which you are generating the files. For details, see "Generating the XAP and HTML Files for a Silverlight Stateless Application", in Chapter 1. Use the Browse button to search for the output directory, if required. When you click the Browse button, the common Browse for Directory dialog is then displayed, to enable you to select the appropriate location. 7. To retain the build directory, check the Retain XAP build directory check box. When this check box is checked, if the build fails, the log files are not copied to the logs directory, as these files can be found in the retained build directory.

54 Chapter 2 Using the XAML Browser Click the Generate button to generate the files. Alternatively, click the Cancel button to abandon your entries. While the files are the being generated, the XAP File Generation Progress dialog is displayed, checking off actions as they are successfully completed, as shown in the following diagram. For details about the generation process and how JADE records any failures, see "Generating the XAP and HTML Files for a Silverlight Stateless Application", in Chapter 1. Selecting the XAML Browser Mode The XAML Browser enables you to select the operating mode. By default, the XAML Browser is displayed in Navigate mode, which enables you to navigate around your XamlDocument subclasses. In Paint mode, the navigator region and the XAML or preview region is replaced by an instance of the XAML Painter. Note You cannot use the XAML Browser in Paint mode if you have unsaved XAML code changes. You can, instead, use the Preview sheet to preview the effect of your changes to the XAML code that you made on the XAML sheet. To toggle the mode of operation, perform one of the following actions Click the required Paint or Navigate radio button in the toolbar. Select the Mode command from the XAML menu and then select the required Paint or Navigate mode. The selected mode is then displayed, and a check mark symbol ( ) is displayed to the left of the command in the Mode submenu. Note The Paint option is disabled if you are not running JADE on a presentation client (that is, you are running a standard client or you attempted to operate in Paint mode on an application server), because the XAML Painter is a Silverlight application that can run only from a presentation client. Hiding or Showing the Toolbar The toolbar is displayed by default in the XAML Browser (in the Navigate and Paint modes). You can hide the toolbar if you want to maximize the area for XAML or the preview area, for example.

55 Chapter 2 Using the XAML Browser 55 To toggle the display of the toolbar Select the Hide Toolbar or Show Toolbar command from the XAML menu. When the toolbar is displayed, click the close icon at the upper right of the toolbar. When the toolbar has been hidden, the Show Toolbar command is displayed in the XAML menu instead of the Hide Toolbar command. To display the toolbar when it has been hidden, select the Show Toolbar command from the XAML menu.

56 Chapter 3 Painting XAML Documents This chapter covers the following topics. Using the XAML Painter Accessing the XAML Painter Properties Area of the XAML Painter Painting Area of the XAML Painter XAML Area of the XAML Painter Using Function Keys and Shortcut Keys Creating a XAML Document Adding a New XAML Document Adding UI Elements to Your Document Defining the Layout of Your XAML Document Maintaining Properties for Your XAML Document or UI Element Defining Methods for Your Document Saving Your Document Editing an Existing Document in the XAML Painter Using the Keyboard and Mouse to Edit Your Document Changing a UI Element Type Effects of Editing an Existing Document Deleting a Document Layout Toolbar Using the XAML Painter Use the XAML Painter to: Paint User Interface (UI) elements onto XAML documents in your schema View and maintain the XAML of a XAML document The XAML Painter enables you to create and maintain XAML documents of your Silverlight application. The XAML Painter is a graphical user interface (GUI) painter that supports bitmaps, list boxes, button controls, and so on. XAML documents have references to UI elements, which have properties, events, and event logic defined on them. UI elements display information and permit user input. The properties of UI elements determine aspects of their appearance (for example, position, size, or color) and aspects of their behavior (for example, whether they can be resized).

57 Chapter 3 Painting XAML Documents 57 Note You cannot paint a XAML document until you have created that document. For details, see "Adding a New XAML Document", later in this chapter. Alternatively, if you have started painting a XAML document but have not yet created it, use the Save As command to save your document. For details, see "Saving Your Document as another Name", in Chapter 2. The XAML Painter provides for "what you see is what you get" (WYSIWYG) painting of XAML documents in a similar manner to the JADE Painter. Additionally, it enables you to view and update the XAML contained within the XAML document. You can start multiple copies of the XAML Painter, which can run in parallel with one or more copies of the XAML Browser. (For details about the XAML Browser, see Chapter 2.) Notes The XAML Painter can be run only from a presentation client and if a base locale is set for your JADE system. In addition, you cannot toggle to the Paint mode to preview a document in the XAML Browser if you are running a standard client. You can access the XAML Painter from a user-defined schema only; that is, you cannot access it from the RootSchema. Accessing the XAML Painter To access the XAML Painter, perform one of the following actions Select the XAML Painter command from the File menu of a standard browser window. When a XamlDocument subclass is selected in the standard JADE development environment Class Browser, perform one of the following actions. Select the Edit XAML Document command from the Classes menu. Right-click on the XAML document in the Class List pane and then select the Edit XAML Document command popup menu that is then displayed. Right-click on the Painter toolbar button (you must have already selected a XAML document in the Class List pane).

58 Chapter 3 Painting XAML Documents 58 The XAML Painter is then displayed. If you accessed the XAML Painter from the Class Browser, the XAML for the selected document subclass is then displayed, as shown in the following diagram. You can also access the XAML Painter by using the XAML Browser in Paint mode. For details, see "Selecting the XAML Browser Mode", in Chapter 2. The XAML Painter contains the following areas. Properties area, at the left of the painter, lists the dialogs that enable you to set the properties of the UI elements of the document that you are editing. The Controls dialog is the only dialog that is expanded when you first open the XAML Painter. For details, see "Properties Area of the XAML Painter", later in this chapter. Painting area at the upper-right of the painter shows the document as you are editing it. In addition, that Painting area has a toolbar and additional options to help you to layout the UI elements on your document. The additional options, displayed when you click the options hyperlink, are not displayed by default. For details, see "Painting Area of the XAML Painter", later in this chapter. XAML area, at the lower-right of the painter, displays the XAML code of the document that you are editing or additional instructions about the XAML Painter. For details, see "XAML Area of the XAML Painter", later in this chapter. For details about the XAML menu of the XAML Painter, see "Using the XAML Menu", in Chapter 2.

59 Chapter 3 Painting XAML Documents 59 Properties Area of the XAML Painter The left side of the XAML Painter contains dialogs that enable you to specify properties on the current document and its UI elements, as well as additional views that allow for a variety of ways for interacting with the current document. When you change a property by using a dialog in the Properties area, the associated XAML attribute is updated and the Painting area and XAML area are updated immediately. You can also change the properties of a UI element or document by editing the code on the XAML View sheet directly (you must click the Load XAML button, to see your changes) in the Painting area. An example of the Properties area, with the Controls dialog fully expanded, is shown in the following diagram. Expand or contract each dialog individually by clicking on the arrow at the upper left of that dialog. (When you position your cursor over the button, the arrow turns light-blue.) If more properties are available to view in that dialog, More is displayed at the lower left of that dialog. Click the adjacent arrow to additionally expand that dialog.

60 Chapter 3 Painting XAML Documents 60 Alternatively, to expand or contract all of the dialogs in the Properties area, click the toggle expanders hyperlink at the upper right of the Properties area. Depending on the document type or UI element that you are maintaining, some or all of the following dialogs may be displayed in the Properties area. Controls dialog provides access to the UI elements that you can add to the current document. Add UI elements by using the Available Controls combo box, in which UI elements are sorted alphabetically, or by using the Controls by Category tree view, which groups UI elements by type. For details about adding a UI element to a document, see "Adding UI Elements to Your Document", later in this chapter. Use the Page Controls combo box to search for a UI element on a document. For details, see "Selecting a UI Element", later in this chapter. Zoom dialog enables you to zoom in and out of the current document, which is useful to see the complete document or to concentrate on a specific part of a document. For details, see "Expanding or Contracting the View of a Document", later in this chapter. Document Outline dialog, shown in the following diagram, provides a hierarchy view of the current document. The Page element is the highest level in the document hierarchy. The number of sub-elements depends on the document that you are viewing. Click the unfilled arrow at the left of an element to expand it and display its sub-elements. An element that is fully expanded displays a dark solid arrow at its left. An element that has no sub-elements displays no arrow. Select an item in this dialog to select the corresponding UI element in the Painting area or to edit its properties using the available dialogs in the Properties area. The selected UI element is then highlighted with a red border in the Painting area. Select multiple UI elements by holding down CTRL and then clicking on each element in the Document Outline dialog (or the Painting area). The master UI element is displayed with a red border and subsequent selections have a green border. Changes that you make are applied to all of the selected UI elements. For details about selecting one or more UI elements, see "Selecting a UI Element", later in this chapter. General Properties, Size and Position, Colors and Styling, Fonts, Grid Definition, Miscellaneous, and Transformations dialogs enable you to maintain properties that are specific to the selected UI element. For details, see "Maintaining Properties for Your XAML Document or UI Element", later in this chapter.

61 Chapter 3 Painting XAML Documents 61 Expanding or Contracting the View of a Document The Zoom dialog is useful when you require a: Close view of a section of a document; for example, if you need to concentrate on a specific part of a document. Complete view of a document; for example, so that you can see the layout of the UI elements on a document. The zoom ranges in magnification from 10 percent through 800 percent of the document size and does not affect the saved size of the document. Click the Reset button, to reset the zoom to 100 percent. To expand or contract the view of a document Click the expander button at the upper-left of the Zoom dialog, in the Properties area, to display the Zoom dialog shown in the following diagram. The area that is currently visible in the Painter area, at the right of the XAML Painter, is represented by a light-purple shaded area, referred to as the zoom navigator overlay in this section. If the whole document is visible in the Painter area, the zoom navigator overlay is not displayed. To zoom in on the document, perform one of the following actions Slide the Zoom slider to the right. In the text box at the right of the Zoom slider, enter the magnification at which you want to view the document in the text box and then press ENTER. The document in the Painter area is then enlarged; that is, zoomed in. You could have to scroll horizontally or vertically to view other parts of the document in the Painter area. Alternatively, use the Zoom navigator overlay to move around in the Painter area. Scrolling the Painter area updates the current view in the zoom preview window. The zoom preview window is a live copy of the UI elements on the document that you are editing. If you are viewing a complex document, it may be advisable not to show the preview in the zoom window. The zoom and navigation behavior is still available.

62 Chapter 3 Painting XAML Documents 62 To zoom out from the document, perform one of the following actions Slide the Zoom slider to the left. In the text box at the right of the Zoom slider, enter the magnification at which you want to view the document in the text box and then press ENTER. The document in the Painter area is then reduced; that is, zoomed out. Painting Area of the XAML Painter The Painting area shows the layout of the UI elements on the document that you are editing. Use the Painting area and the dialogs in the Properties area to manipulate the size, position, and alignment of UI elements on the document. You can select and manipulate items in the Painting area using the mouse. The Properties area at the left of the XAML Painter displays the properties of the selected item (or the primary selection in a multiple-selection situation). The Options panel, shown in the following diagram, is at the top of the Painting area and contains a set of tools that are frequently used when manipulating the layout of UI elements on your document. The additional alignment check boxes, displayed when you click the options hyperlink, are not displayed by default. The following table lists the hyperlinks at the left of the Options panel. Hyperlink delete undo redo xaml Description Deletes the selected UI element or elements. Undoes the last action that you performed. You can undo up to ten previous actions. Redoes the last action that you performed. You can redo up to ten actions. Toggles (displays or hides) the XAML area. The Layout toolbar buttons enable you to align selected UI elements on a document. For details, see "Layout Toolbar", later in this chapter. Alignment check boxes, displayed at the bottom of the Options panel when the options hyperlink is clicked at the right of the toolbar, are enabled only for UI elements that have a Canvas parent. For details, see "Options Panel Check Boxes", later in this chapter. For details about using the Layout toolbar buttons and additional layout options, see "Defining the Layout of Your XAML Document", later in this chapter. XAML Area of the XAML Painter The XAML area, at the lower-right of the XAML Painter, contains the following sheets. XAML View sheet, which displays the XAML code of the document that you are editing. Edit the XAML code on this sheet manually, if required. If you edit XAML code by using the XAML View sheet, click the Load XAML button to update your view of the Painting area.

63 Chapter 3 Painting XAML Documents 63 The code in the XAML View sheet is updated immediately, if you edit a UI element by using a properties dialog, or by directly interacting with the UI element in the Painting area. Note If you edit the XAML document manually, ensure that you are making valid changes; for example, do not have duplicate names, do not duplicate any x:uid attributes, and so on. If you attempt to load invalid XAML, the XAML Painter may not be able to catch any exceptions raised by the Silverlight plug-in. In the worst case, Silverlight does not raise an exception that the XAML Painter can catch, it simply crashes and you must restart the XAML Painter. The XAML that is displayed on the XAML View sheet is sent back to JADE when you save the document. That XAML is then parsed and used to build the JADE representation of the document. General Instructions sheet, which displays an overview about how to use the Painter area to manipulate the UI elements of a document. The details on this sheet are read-only. Hide the XAML area, if you want to maximize the Painting area for the document that you are editing. To toggle the display of the XAML area Click the xaml hyperlink, in the Options panel. To select all of the XAML code that is displayed on the XAML View sheet Click the Select All button. You can then copy the XAML into a new document by using standard cut and paste functionality. Using Function Keys and Shortcut Keys You can use the keyboard to perform functions to the XAML on the XAML View sheet of the XAML Painter. The keyboard shortcut commands on the XAML View sheet follow standard conventions. In addition, the XAML View sheet uses some, but not all, of the keyboard shortcuts that the XAML Browser uses. For details, see "Using Browser Shortcut Keys", in Chapter 2. Press F1 to display online help for the item with input focus. The following table summarizes the most common keyboard and mouse interactions used to perform various actions in the Painting area. Key or Combination CTRL+left-click ALT+left-click SHIFT+left-click Description Selects additional UI elements (this also applies in the Document Outline dialog). Clones the currently selected UI element (and its sub-elements), to build multiple controls. This enables you to build an interface quickly. For example, to copy a StackPanel that contains a TextBlock and a ComboBox: 1. Select the StackPanel. 2. Press ALT. 3. Drag the StackPanel to the new position on the document. After you release the mouse button, the StackPanel and its child UI elements are copied to the new position on the document. Attempts to re-parent the dragged UI element onto the item under the cursor.

64 Chapter 3 Painting XAML Documents 64 Key or Combination ALT+SHIFT+left-click ESC DELETE Description Clones the selected UI element and moves the clone onto the target parent. Deselects all currently selected UI elements. Deletes the currently selected UI elements. Creating a XAML Document This subsection covers the following topics. Adding a New XAML Document Subclassing XAML Controls and Documents Adding UI Elements to Your Document Selecting a UI Element Cloning UI Elements Naming a UI Element Adding Container UI Elements Changing the Caption Content of a UI Element Overlapping UI Elements Changing the Runtime Tab Sequence Obtaining Help for a UI Element Defining the Layout of Your XAML Document Sizing Your UI Elements Aligning Your UI Elements Spacing Your UI Elements Options Panel Check Boxes Using Grid Lines to Position UI Elements on XAML Documents Locking the Position of UI Elements on Your Document Direct Select Functionality Previewing UI Elements on Your Document Examples of Laying Out UI Elements Maintaining Properties for Your XAML Document or UI Element Maintaining General Properties Maintaining Size and Position Properties Maintaining Colors and Styling Properties

65 Chapter 3 Painting XAML Documents 65 Maintaining Font Properties Maintaining Grid Definitions Maintaining Miscellaneous Properties Maintaining Transformations Defining Methods for Your Document Adding a New XAML Document Use a XAML document to create an interface for your JADE applications. A XAML document is a window on which you paint UI elements for the running of your application. UI elements are objects such as text boxes, list boxes, buttons, check boxes, and so on. You can create documents in the XAML Browser or the XAML Painter. If you create a document from the XAML Browser when in Navigate mode, the XAML Browser changes to Paint mode automatically after you click the OK button on the New XAML Document dialog. All XAML documents are subclasses of the XamlDocument class. A document can be a subclass only of another user-defined document class or of the XamlDocument system class. Existing documents are listed in the Subclass of combo box, to enable you to select the document that is to be subclassed. A sub-document inherits all of the methods and properties of its parent, or super-document. For details, see "Subclassing XAML Controls and Documents", in the following subsection. The XAML UI element hierarchy is located under the XamlObject class. Create a new XAML document by: Creating a new top-level document Subclassing an existing document If you create a top-level document, you can apply an initial structural template to the document (by using the Style combo box on the New XAML Document dialog). The structural template provides an initial framework on which you can build your document. Note When you define an application for your schema, you must specify the XAML document that is displayed when the application is started. For details, see "Defining a Silverlight Application", in Chapter 1. To create a new XAML document 1. Select the New command from the XAML menu. The New XAML Document dialog is then displayed. For details, see "Adding a New Document", in Chapter After you click the OK button, the new document is opened in the XAML Painter, ready to be edited. Depending on the type of document that you created, some basic XAML code is displayed in the XAML View sheet, by default. 3. After you make your changes, press CTRL+S or select the Save command from the XAML menu, to save your document. The document is not saved automatically and displays unsaved in the title until you save it.

66 Chapter 3 Painting XAML Documents 66 If you attempt to select another document or to close the XAML Painter before you have saved the changes to the current document, the Query Save Changes dialog is displayed. For details, see "Saving Your Document", in Chapter 2. An example of a new unsaved document in the Grid Based - Sizeable, Scrollable style is shown in the following diagram. Note If you create the document in the XAML Painter, the Navigator pane at the left of the XAML Browser is updated immediately after you save the document. After you create a XAML document, you can paint UI elements onto the document, by using the Painting area or by editing the XAML on the XAML View sheet. For details, see "Adding UI Elements to Your Document", later in this chapter. After adding UI elements, you can additionally manipulate them by using your mouse to select or move them. The properties of the selected UI element are displayed in the Properties area. Named UI elements only can be selected in the Painting area or the Properties area. All UI elements added in the XAML Painter are named, by default. A named UI element has a Name XAML attribute. An unnamed UI element cannot be considered a potential parent UI element. Name a UI element manually, if required. For details, see "Naming a UI Element", later in this chapter. All named UI elements are available as references in JADE when you save the document.

67 Chapter 3 Painting XAML Documents 67 If you want a UI element to be selectable in the XAML Painter but you do not want it to be a referenced item in JADE, clear the name of the UI element in the Name text box in the General Properties dialog. The UI element is then assigned a painter-only name that allows for interaction in the XAML Painter; for example, _NoJadeName_1. The base element of the document (typically the background or LayoutRoot element) can be selected, but does not allow itself to be moved by dragging. The reason for this is that the layout style usually determines the position of the element in the browser at run time and you must, therefore, make an explicit decision to set up offset margins and so on for your document; otherwise, it is easy to drag the element around, creating offsets, without visualizing what would happen to the position at run time. To move or resize the base element, use the Size and Position dialog in the Properties area. For details, see "Maintaining Colors and Styling Properties", later in this chapter. Tip When subclassing a document, introducing a panel or panels that will contain all of the new sub-document UI elements reduces the number of placeholder items that need to be reflected throughout the XAML hierarchy. To find a UI element on your document, select that UI element in the Page Controls combo box in the Controls dialog and then click the Find button, or select that UI element in the Document Outline dialog. The selected element is then highlighted with a red border in the Painting area. For details, see "Selecting a UI Element", later in this chapter. Subclassing XAML Controls and Documents Although you can apply JADE-style subclassing to XAML controls (subclasses of UIElement) and XAML documents (subclasses of XamlDocument), there are several things of which you should be aware. For details, see the following subsections. Control Subclassing All of the classes in the JADE hierarchy under UIElement represent controls that can be subclassed. Subclassed controls are listed in the Available Controls combo box in the Properties area of the XAML Painter. In the XAML code, the type of the control is always the type that JADE uses for the superclass. For example, if you subclass XamlButton as MyXamlButton, in the XAML Painter you can add a MyXamlButton to the document. The JADE reference created for this UI element is of the type MyXamlButton, but in the XAML code it is a Button. (The JADE class XamlButton maps to the Button XAML object.) Control subclassing should be used only to specify special functional behavior and it should not be used to redefine the look and feel of a control. To change the look and feel of a control, you must add a resource, written in XAML, to the document and then apply this resource to the control using the style or template property of the control. Function and look and feel are completely separated in the Silverlight environment and subclassing should be used only to define different functionality. Document Subclassing When you create a new XamlDocument, you can specify the document of which it will be a sub-document (or subclass). The points to note about subclassed documents are as follows. A sub-document includes all of the XAML of the document from which it was created; that is, the parent or super-document. The sub-document, therefore, initially looks the same as the parent document and contains the same UI elements. When you edit a sub-document, you cannot change any of the XAML that was inherited from the parent; that

68 Chapter 3 Painting XAML Documents 68 is, the position or property values of those UI elements is fixed. You can, however, add new UI elements to the sub-document. New UI elements must be named and you can add additional content (which does not need to be named) to new UI elements. If you add content to a document that has sub-documents, those sub-documents are also updated with the new content. A UIElement (a control) has a property created in the corresponding JADE class for the top-most level in which that control is defined; for example, top-level document D1 has a button b1, and sub-document D2 has button b2. In the class D1 in JADE will be a property b1, and class D2 (a subclass of D1) will have a property b2. However, the XAML for D2 will, by the above rules, contain a UIElement for b1. JADE connects XAML UIElements to JADE properties by inserting a Unique Identifier (Uid) attribute into the XAML. JADE adds placeholders, with an appropriate Uid value, in the XAML of the parent document at the place where you add the new UI element in the sub-document. This is required so that changes to the parent document can be populated to the XAML of the sub-document. Caution If directly editing the XAML, take great care if you alter the Uid attribute. The Uid attribute in the XAML is updated only after you save your changes. The Compare XAML dialog enables you to compare the XAML of a sub-document with the XAML of the parent document. For details, see "Comparing the XAML Changes in Parent and Sub-documents", in Chapter 2. Adding UI Elements to Your Document Use the Controls dialog in the Properties area to add a new UI element to your current document. In addition to adding UI elements from the Controls dialog, you can clone the currently selected UI element (and its sub-elements), to quickly build multiple controls. For details, see "Cloning UI Elements", later in this chapter. Note You can also add a UI element by editing the XAML directly in the XAML View sheet. If you copy and paste UI elements within the XAML View sheet, ensure that Name attributes are unique. For details about editing a document, see "Editing an Existing Document", later in this chapter. All actions occur against the currently selected UI element or elements. To clear all selections in the Painting area, press the ESC key. Note You cannot paint a XAML document until you have created that document. For details, see "Adding a New XAML Document", earlier in this chapter. Alternatively, if you have started painting a XAML document but have not yet created it, use the Save As command to save your document. For details, see "Saving Your Document as another Name", in Chapter 2. To add a new UI element to your document 1. Select the level at which to add the UI element within the document; for example, if you select an existing UI element, the one you are adding is added as a child. Use the Document Outline dialog, to select the level at which you want to add the UI element. Alternatively, select the required UI element, in the Painting area.

69 Chapter 3 Painting XAML Documents To specify the type of UI element that you want to add, perform the following actions in the Controls dialog. a. In the Available Controls combo box, select the type of UI element that you want to add. Alternatively, click the More button to expand the Controls dialog and then select the required UI element under the Controls by Category tree. b. Click the Add button. The specified UI element is then displayed at the upper left of the document in the Painting area and the corresponding XAML code is added to the XAML area. Note A Silverlight popup-type control cannot be directly displayed in the XAML Painter because it does not have a development-mode operation. The XAML Painter substitutes a XamlBorder control for the popup window when displaying the control, provided that the XamlPopup window is the direct content of a top-level <UserControl> element. If it is not, neither the popup window nor its content can be displayed or selected. When a XamlPopup control can be displayed using a XamlBorder control substitute, the painter operation is seamless, except that only changes to the Width and Height properties for the popup window are displayed in the Painting area. You can view other property changes to that control only at run time. 3. Select the UI element and then size and position it accordingly. To: Size the UI element, drag the border of the UI element to the required size. When you position your cursor over a border, it becomes a double-headed arrow indicating that you have selected a border. Position the UI element, click inside the UI element, and then drag it to the required position on your document. For details, see "Defining the Layout of Your XAML Document", later in this chapter. 4. Apply properties to your UI element by using the dialogs in the Properties area. For details, see "Maintaining Properties for Your XAML Document or UI Element", later in this chapter. 5. To save your document, select the Save command from the XAML menu, or press CTRL+S. All UI elements are children of the document or container UI element on which they are painted. Being a child UI element affects the placement of the UI element within the parent document or container. The left and top properties of a UI element are relative to the parent UI element. Moving the document or container also moves the UI elements. Tip Check the Grid Lines check box, in the Options panel, to display grid lines to assist you to position your UI elements on the document, if required. (For details, see "Defining the Layout of Your XAML Document", later in this chapter.) For details about changing the type of an existing UI element on a document (for example, changing a ComboBox UI element to a TextBox UI element), see "Changing a UI Element Type" under "Editing an Existing Document in the XAML Painter", later in this chapter. Selecting a UI Element Select a UI element to move or resize it on your document or to change its properties.

70 Chapter 3 Painting XAML Documents 70 Note You can select only named UI elements in the Painting area or the Properties area. All UI elements added in the XAML Painter are named, by default. Name a UI element manually, if required. For details, see "Naming a UI Element", later in this chapter. To select a UI element Perform one of the following actions. In the: Painting area, select the UI element. To select disabled UI elements (that is, elements that you cannot select by using your mouse), use the Page Controls combo box or select it on the XAML View sheet. Controls dialog, select the UI element in the Page Controls combo box and then click the Find button. Note You can select the XamlMediaElement, XamlItemsControl, XamlContentControl, XamlImage UI elements using the Page Controls combo box only; that is, you cannot select them by using your mouse. After the XamlImage and XamlMediaElement elements have content, you can select them in the Painting area by using your mouse. Document Outline dialog, select the UI element. Note You could have to scroll around the Painting area until you can see the selected UI element. The selected UI element is then highlighted by a red border if it is the first (that is, master selection) UI element selected in a series. Properties of that UI element are then displayed in the dialogs in the Properties area. UI elements selected in addition to the master element are highlighted with a green border. The master selection can be moved by clicking somewhere inside the red border and dragging it to the required position. If you selected multiple UI elements, they are moved relative to the master selection. Similarly, if you resize the master selection, all other selected UI elements are resized accordingly. To select additional UI elements, press CTRL and then select each UI element. Subsequent UI elements are highlighted with a green border. If you move or resize the master UI element, all other selected UI elements are move or resized accordingly. In the following diagram, All items is the master selection and Retail items and Items for tender are additional selections. To deselect a UI element that is already selected While holding down the CTRL key, click on the UI element that you do not require in the selection. Cloning UI Elements Clone the currently selected UI element (and its sub-elements), to quickly build multiple controls.

71 Chapter 3 Painting XAML Documents 71 To clone one or more UI elements 1. Select the UI element or container that you want to clone. For details, see "Selecting a UI Element", earlier in this chapter. 2. Press ALT+left-click. For details, see "Using Function Keys and Shortcut Keys", earlier in this chapter. The cloned UI elements are then displayed at the top left of your document. Naming a UI Element Any UI element added directly in the XAML Painter is named. However, if you introduce code from an external tool, the provided control elements may not be named. To name a UI element manually 1. Edit the XAML on the XAML View sheet, to add a Name attribute to the UI element. If you add a Name attribute, you must follow the attribute naming convention that is used in the rest of the document; for example, the document could use the convention Name="MyControl" or x:name="mycontrol", or some variation. You cannot use different attribute naming conventions in the same document. 2. Click the Load XAML button, to load your changes into the current editing session. Named UI elements display their name in square brackets in the hierarchy in the Document Outline dialog; for example, the named Button item in the following diagram displays [btnerrorok]. Adding Container UI Elements JADE XAML enables you to add multiple UI elements to other UI elements. This document refers to any UI element that contains other elements as a container. The following are the main styles of UI element that you use in JADE XAML. A ContentControl allows only a single piece of content; for example, a caption on a button. An ItemsControl can display a collection of items; for example, a ListBox or a ComboBox. The Panel is a layout manager type of control. The Canvas, Grid, and StackPanel UI elements are types of Panel. Panels are designed to hold multiple UI elements. The layout of UI elements within the Panel

72 Chapter 3 Painting XAML Documents 72 depends on the type Panel (as each panel type exerts its own layout requirements on the UI elements it contains). For details, see "Using Layout Manager UI Element Types", in Chapter 4. Even though a ContentControl is allowed only one piece of content, there is no restriction on the type of content (as long as there is only one). In the XAML Painter, if you drag a UI element into a ContentControl that already has content, the painter recognizes the existing content and: 1. Removes the existing content from the UI element. 2. Adds a StackPanel in the place of the original content (respecting the rule that a ContentControl can have only one child item). 3. Adds the original content to the StackPanel as well as the UI element that you were trying to add. The ContentControl has one piece of content; that is, the StackPanel. The StackPanel can contain multiple UI elements, and it now manages the content that you want to display. A container UI element must be added before the UI elements that it is to contain. When a container UI element is in place, other UI elements can be added within its boundaries. The following diagram shows an example of Button, CheckBox, and ListBox UI elements within a Canvas container. To move an existing UI element in a container, use the mouse to drag the UI element to the required position. Changing the Caption Content of a UI Element The Content property or attribute of a UI element determines the caption that is displayed on that element at run time; for example, a button name. To change the content of a UI element 1. Select the UI element whose content you want to specify. For details, see "Selecting a UI Element", earlier in this chapter. 2. Perform one of the following actions. In the: General Properties dialog, enter the content in the Content text box and then press the ENTER key or the TAB key.

73 Chapter 3 Painting XAML Documents 73 Painting area, perform a long-left-click on the UI element. The UI element is then highlighted in orange and the content text is selected for editing, as shown in the following diagram. Edit the content, as required, and then click outside the element, to view your change. XAML View sheet, edit the Content attribute of the UI element and then click the Load XAML button. The content is then updated. Overlapping UI Elements When two or more UI elements overlap, you can specify which UI element appears on top of or behind the other UI element or elements, by using the XAML View sheet. The UI elements on a Canvas have an additional property, the zindex, that enables you to specify which UI element sits on top of another. For details, see "Canvas UI Element Type", in Chapter 4. UI elements are added to a document or container in controllist order (that is, the order in which you add them to the document or container). The last UI element in the controllist order is displayed on top of any other UI elements in the document or container, by default. In the following example, the ListBox UI element is the last in the controllist and is displayed on top of the CheckBox UI element in the container (all UI elements in the examples have the same zindex value). In the following example, the CheckBox UI element is the last in the controllist and is displayed on top of the ListBox UI element in the container.

74 Chapter 3 Painting XAML Documents 74 Changing the Runtime Tab Sequence The TabIndex property or attribute of a UI element determines its tab sequence order on a document at run time. Specify the tab order of each UI element on a document individually. To change the tab sequence that the user experiences at run time 1. Select the UI element whose tab sequence order you want to specify. For details, see "Selecting a UI Element", earlier in this chapter. 2. In the General Properties dialog, enter the tab sequence order value in the TabIndex text box. Enter a value in the range 1 through Alternatively, edit the TabIndex attribute of the UI element on the XAML View sheet. 3. Press the ENTER key or the TAB key, or click the Load XAML button if you edited the value on the XAML View sheet. The tab sequence order is then applied to the UI element. 4. Repeat steps 1 through 3 for each UI element whose tab sequence order value you want to change. By default, JADE assigns a tab sequence order to UI elements as you define them on your document. Each new UI element is placed last in the tab sequence order. The valid range is any integer value. Note UI elements are added to the document in controllist order (that is, the order in which you add them to the document). The order in this list can change during editing, because parent UI elements must always precede their children. UI elements are copied to the XAML Painter clipboard in controllist order. When pasted, each UI element has the same tab sequence order value as the original UI element. If the tab sequence order of a UI element has not been used in the new document (that is, the document on which you paste the UI element), the pasted UI element retains its tab sequence order value. A UI element pasted on to a document can therefore have a tab sequence order that differs from the one that it had on the original document, although in most cases, the tab sequence order corresponds to that of the original document (particularly when pasting controls on to new documents). Unlike JADE, the XAML Painter does not automatically renumber the tabindex value of other UI elements to reflect insertions, deletions, and changes that would result in a tab number conflict. The tab sequence order is a guide only and JADE XAML is not affected by a number conflict. At run time, invisible or disabled controls and controls that cannot receive the focus (for example, Borders and TextBlocks) remain in the tab order but are skipped during tabbing. Obtaining Help for a UI Element Press F1 to access the page of the PDF file that provides information about the UI element type that has focus; for example, select a combo box and then press F1. Online help that relates directly to the UI element that has focus on a document in the JADE Painter is then displayed. For example, if a TextBox control is selected, the "TextBox Class" JADE online help topic is displayed. Defining the Layout of Your XAML Document The Layout toolbar and check boxes in the Options panel enable you to fine-tune the sizing and placement of UI elements on your painted XAML document. For example, if you have painted a row of buttons, you may want to space them neatly on your XAML document and make them all the same size.

75 Chapter 3 Painting XAML Documents 75 The Layout toolbar and check boxes in the Options panel are intended primarily for use with the Canvas UI element type. Notes Some Layout toolbar buttons cannot be selected if you have not selected a group of two or more UI elements (that is, they are disabled). All alignments are relative to the whole XAML document unless you have selected a container, in which case alignments are relative to the container. For details, see "Adding Container UI Elements", earlier in this chapter. For those Layout toolbar buttons that align relative to a master UI element, the first UI element that you select in a group becomes the master. The master UI element is highlighted by a red border and any additional UI elements that you select have a green border. The Layout toolbar buttons can be divided into the following functions. Alignment Spacing Size Tip Click the undo hyperlink in the Options panel, to undo the last action that you performed. For details, see "Painting Area of the XAML Painter", earlier in this chapter. To select a group of UI elements and assign a master UI element 1. Click the first UI element of your proposed group. 2. While holding down the CTRL key, click the other UI elements that are to be in your group. The first UI element that you select becomes the master UI element. Sizing Your UI Elements Use your mouse to resize UI elements on your document in the Painting area. To resize the height or width of UI elements in the Painting area 1. Select a UI element. For details, see "Selecting a UI Element", earlier in this chapter. 2. Position your cursor on the side of the UI element that you want to drag to resize. Your cursor then becomes a double-headed arrow. 3. Drag the side to the require position and then release the mouse button. To resize both height and width at the same time, move the mouse over the corner of the UI element and then drag the corner until the element is the required size. (Your cursor becomes a double-headed diagonal arrow when positioned over the corner of the element.) The Same Width and Same Height toolbar buttons, listed in the following table, enable you to standardize the size of the UI elements on your document. Toolbar Button Button Name Description Same Height Makes all selected UI elements the same height Same Width Makes all selected UI elements the same width

76 Chapter 3 Painting XAML Documents 76 You can also use the Size and Position dialog to scale a UI element so that it fits the current document. Before you align and space the UI elements on your document, you may want to make some elements identical in size; for example, button elements. You may also want to standardize the width or the height of other UI elements. Tip When laying out your document, standardize the size of UI elements before using the alignment and spacing layout buttons, as the size buttons can alter the spacing of your UI elements. Aligning Your UI Elements Use your mouse to move UI elements on your document in the Painting area. Use the check boxes in the Options panel to provide additional alignment functionality for documents that have a Canvas parent. For details, see "Options Panel Check Boxes", later in this chapter. The toolbar buttons, listed in the following table, enable you to align UI elements on your document. Toolbar Button Button Name Description Align Bottom Aligns to the bottom edge of the master UI element Align Top Aligns to the top edge of the master UI element Align Left Aligns to the left edge of the master UI element Align Right Aligns to the right edge of the master UI element Vertically Adjacent Makes the selected UI elements vertically adjacent Horizontally Adjacent Makes the selected UI elements horizontally adjacent Align Centers Horizontally Centers the selected UI elements horizontally Align Centers Vertically Centers the selected UI elements horizontally Spacing Your UI Elements The Align Bottom, Align Top, Align Left, Align Right, Vertically Adjacent, Horizontally Adjacent, Align Centers Horizontally, Space Evenly Down, and Space Evenly Across toolbar buttons enable you to neatly and logically space your UI elements across or down the document or container UI element. The Space Evenly Across, Space Evenly Down, Horizontally Adjacent, Align Centers Horizontally, and Vertically Adjacent toolbar buttons are disabled if you have not yet selected a group of controls. To enable the Space Evenly Across and Space Evenly Down toolbar buttons, you must select at least three UI elements. When using the Vertical Standard Spacing, Horizontal Standard Spacing, Vertically Adjacent, and Horizontally Adjacent commands or toolbar buttons, the position of the master control (that is, the control that is displayed with a red border) remains unchanged and not the control that is in the top or the farthest left position.

77 Chapter 3 Painting XAML Documents 77 The toolbar buttons, listed in the following table, enable you to space UI elements on your document. Toolbar Button Button Name Spaces the selected UI elements evenly Space Evenly Down Down the container Space Evenly Across Across the container Options Panel Check Boxes Check boxes in the Options panel, displayed when the options hyperlink is clicked at the upper right of the XAML Painter, are enabled only for UI elements that have a Canvas parent. The check boxes, which are unchecked by default, are listed in the following table. Check Box Grid Lines Metrics Snap To Grid Snap To Cell Preview Mode Direct Select Lock Description Toggles (displays or hides) an alignment grid that has a spacing of ten pixels. Toggles (displays or hides) the display of additional positional information for the master control, indicating the offsets and sizes of the master selected UI element. Snaps (moves) a selected UI element to the nearest grid intersection when the UI element is moved. Modifies the width and height of the selected UI element to the nearest grid line (that is, sets its size to the nearest grid intersection). As this is applicable only when the Snap To Grid check box is checked, it occurs after the UI element is snapped to the nearest grid intersection. Enables interaction with the UI elements on the current document. Determines the mouse interaction with a UI element by the selection rectangle rather than the visual element directly under the mouse pointer. Toggles (enables or disables) the moving of UI elements by using the mouse (the controls can still be moved by changing positions in the property dialogs). Using Grid Lines to Position UI Elements on XAML Documents Grid lines assist you to position UI elements on your XAML documents that have a Canvas parent. You can toggle the display of the alignment grid lines, as required. The superimposed grid lines are ten pixels apart. The alignment grid is not displayed to the user at run time. To toggle the display of alignment grid lines Check or uncheck the Grid Lines check box, to display or hide the alignment grid lines, respectively. To specify additional grid lines and alignment options 1. Check the Snap To Grid check box if you want to control the placement of your UI elements. When this check box is checked, the alignment grid lines dictate the placement and movement of UI element on your document, and elements snap to the nearest position on the grid even when the grid is not displayed. 2. Check the Snap To Cell check box and the Snap To Grid check box if you want to control the placement and

78 Chapter 3 Painting XAML Documents 78 size of your UI elements. When both these check boxes are checked, the grid lines dictate the placement, movement, and size of the UI elements on your document, and snap to the nearest position on the grid and the width and height are resized to the nearest grid line even when the grid is not displayed. Note The Snap To Cell check box has no effect unless the Snap To Grid check box is also checked. 3. Check the Metrics check box, to display additional positional information about the master control, including offset and size, of the selected UI element. The following diagram shows an example of the alignment grid lines and measurements that are displayed on a document. Note The Grid UI element is a powerful layout manager that can resize and arrange child elements automatically. For details, see "Grid UI Element Type", in Chapter 4. Locking the Position of UI Elements on Your Document Check the Lock check box, displayed when the options hyperlink is clicked, to lock all of the UI elements on your document so that you cannot accidentally move them by dragging. To lock all UI element positions Check the Lock check box. Direct Select Functionality The Direct Select check box, displayed when the options hyperlink is clicked, determines the mouse interaction with a UI element by the selection rectangle rather than the visual element directly under the mouse pointer. If you select a UI element, check the Direct Select check box, and then click within the boundary of the current selection rectangle, that UI element will continue to be selected even if you click on another UI element. If you do not check the Direct Select check box, the UI element that is currently under your cursor is selected when you click the left mouse button.

79 Chapter 3 Painting XAML Documents 79 To use the direct select function Check the Direct Select check box. Previewing UI Elements on Your Document The Preview Mode check box, displayed when the options hyperlink is clicked, enables you to test the UI elements painted on a XAML document; for example, you can enter text into a text box, click a button, or test the tabbing order. To preview UI elements on your document Check the Preview Mode check box.

80 Chapter 3 Painting XAML Documents 80 Examples of Laying Out UI Elements The following example shows the use of the layout toolbar buttons to arrange the buttons on a XAML document. The buttons were all selected and then made the same size by using the Same Height and Same Width toolbar buttons. With the buttons still selected (and Btn_Button2 as the master selection), use the Vertically Adjacent toolbar button to align your controls, as shown in the example in the following diagram. Finally, you can then space the selected buttons neatly across the document, by using the Space Evenly Across toolbar button, as shown in the example in the following diagram. Note In this example, the buttons have been moved relative to the whole XAML document. If they had been part of a container UI element, they would have been spread evenly relative to the container, not the XAML document.

81 Chapter 3 Painting XAML Documents 81 Maintaining Properties for Your XAML Document or UI Element To maintain the properties associated with your document or UI element, use the dialogs in the Properties area at the left of the XAML Painter. Alternatively, edit the XAML code of the UI element attribute directly in the XAML View sheet. Note If you edit the XAML code directly, ensure that you are making valid changes. If you attempt to load invalid XAML, the XAML Painter may not be able to catch any exceptions raised by the Silverlight plug-in. In the worst case, Silverlight does not raise an exception that the XAML Painter can catch; it simply crashes and you must restart the XAML Painter. The dialogs that are displayed in the Properties area depend on the type of UI element that you select. In general, there are six dialogs covering the various properties. Most of the properties have default settings and many property values are set automatically when you manipulate your document or UI elements in the Painting area or you use some of the layout and alignment options. If the label of a property in a dialog is truncated, as the HorizontalAlignment and VerticalAlignment labels are in the following diagram, click on the light-blue line at the right of the labels and then drag it farther to the right until the whole label is displayed. For all XAML classes, the unit of measurement for widths, heights, radius, and so on, is the device-independent pixel. For details about specific document and UI element properties, see your JADE Encyclopaedia of XAML Classes. The XAML property values and terms with which you may be unfamiliar are: Thickness, which is a unit of measurement that describes the thickness of a frame or border around a UI element. This is typically used when describing a margin or padding, but it is used in other situations for different UI elements. Thickness relates to four measurements (left, top, right, and bottom) that you can define in the property dialogs or in XAML in the styles listed in the following table. Margin Value Description 10 Uniform, which is applied to all four thickness measurements; that is, all sides will have a margin of 10 10,20 The first value is applied to the left and right margins, the second value to the top and bottom margins 10,20,5,15 Asymmetric margins; that is, left = 10, top = 20, right = 5, and bottom = 15

82 Chapter 3 Painting XAML Documents 82 Whichever method you use to set the margin, the display value is displayed in the asymmetric format. NaN, which is a unit that represents that a value is not a number. It is typically seen when the numeric attribute has been removed from the XAML. When the value of that numeric property is queried, it responds that it is NaN not set. This is typically done when you want a parent container to manage the size of a child UI element. By removing the size attribute from the child, you allow the parent to size the child, potentially adjusting the size of the child as the parent itself resizes. (A Canvas parent does not adjust the size of its child elements.) To remove the attribute from the XAML, clear the value in the property dialog and press ENTER, to update the XAML. This removes the attribute from the XAML, leaving a blank property field until next refreshed, at which time it will display NaN; for example, if the Height value is NaN, the attribute is not defined in the XAML and its value is not a number. Infinity, which is a unit that represents that a value is positive or negative infinity. It is typically seen as the default value for items such as MaxHeight; for example, if the MaxHeight value is Infinity, this provides a maximum value for an item (in this example, the MaxHeight for the control does not need to be considered by the layout manager). Maintaining General Properties Use the General Properties dialog of the Properties area to define the common properties for your document or selected UI element. The properties that you can maintain depend on the document or selected UI element. For details about using the Name text box in the General Properties dialog, see "Naming a UI Element", earlier in this chapter. For details about specific document and UI element properties, see the JADE Encyclopaedia of XAML Classes. To change the general properties of your document or selected UI element 1. Select the UI element whose properties you want to change. For details, see "Selecting a UI Element", earlier in this chapter. The dialogs in the Properties area then display the properties associated with the UI element. 2. If a text box is associated with the property, make your change by overwriting the existing value in the text box. 3. If a list box is associated with the property, click on the list box and then make your selection from the menu that is displayed. To change the parent of a UI element 1. Select the UI element whose parent you want to change. For details, see "Selecting a UI Element", earlier in this chapter. 2. In the Parent combo box in the General Properties dialog, select the UI element that you want the selected UI element to reference at run time. The current parent of the selected UI element is displayed in the Parent combo box. Note The display properties of a UI element are relative to the parent UI element. Changing the parent of a UI element affects the placement and visibility of the child UI element.

83 Chapter 3 Painting XAML Documents 83 Maintaining Size and Position Properties Use the Size and Position dialog of the Properties area, accessed by clicking the expand icon at the upper left of that dialog, to change the size and position of UI elements within your document or another UI element. The size and position properties that you can maintain depend on the type of UI element that you select. An example of the Size and Position dialog for a Button is shown in the following diagram. To change the Size and Position properties of your document or UI element 1. Click the property that you want to change. The property is then highlighted, enabling you to specify the required size and position in the associated text boxes and combo boxes. 2. Make your change by overwriting the existing value in the text box, or by selecting the required value in the list box. Additionally, you can use the Layout toolbar to size and align selected UI elements or groups of UI elements. For details, see "Layout Toolbar", later in this chapter. For details about specific document and UI element properties, see the JADE Encyclopaedia of XAML Classes. Maintaining Colors and Styling Properties Use the Colors and Styling dialog of the Properties area, accessed by clicking the expand icon at the upper left of that dialog, to change the color and style properties of your document or UI element.

84 Chapter 3 Painting XAML Documents 84 An example of the Colors and Styling dialog for a Button is shown in the following diagram. To change the color and style properties of your document or UI element 1. Click the property that you want to change. The property is then highlighted, enabling you to specify the required font attributes in the associated text boxes or combo boxes. 2. Make your change by overwriting the existing value in the text box, or selecting the required value in the combo box. Selecting a Color To select a color property for a UI element 1. Click in the combo box of the UI element property whose color you want to change; for example, the Background combo box. 2. To make the UI element transparent, select the Transparent item. Alternatively, to select a color for the UI element, select the Color selector item. The screen shown in the following diagram is then displayed.

85 Chapter 3 Painting XAML Documents 85 The Colors by Hue sheet, shown in the previous diagram, is displayed by default. The Colors by Name sheet enables you to select a color by name (for details, go to step 4, later in this instruction). The currently selected color is displayed at the bottom of the screen, where the Cancel and OK buttons are. 3. To use the Colors by Hue sheet to select a color: a. Perform one of the following actions. In the R, G, and B fields, specify the color in terms of the proportions of red, green, and blue, respectively. Specify a value between 255, the maximum, and zero (0), the minimum, in each field. In the HEX field, enter the color as a hexadecimal value. Select the color by using the color palette, at the left of the sheet. At the right of the color palette, drag the slider, indicated by two black triangles, to the required hue. Click in the circle at the left of the color palette and drag it to the required position, to change the saturation (x-axis) and brightness (y-axis) accordingly. b. The A field (alpha channel) enables you to specify the opacity of the color. A value of 255 means totally opaque and zero (0) means totally transparent. The selected color is displayed at the bottom of the screen, where the Cancel and OK buttons are. 4. To select a color by name: a. Click on the Colors by Name tab to display the Colors by Name sheet, shown in the following diagram. b. By default, the colors are listed in alphabetical order. To list the colors from dark to light, check the Sort dark to light check box that is displayed at the bottom of the screen. c. Click on the color that you want to select. The selected color is displayed at the bottom of the screen, where the Cancel and OK buttons are. 5. Click the OK button, to select that color. Alternatively, click the Cancel button, to abandon your selection. The selected color is then displayed in the combo box in the Colors and Styling dialog. For details about specific document and UI element properties, see the JADE Encyclopaedia of XAML Classes.

86 Chapter 3 Painting XAML Documents 86 Maintaining Font Properties Use the Fonts dialog of the Properties area, accessed by clicking the expand icon at the upper left of that dialog, to change the font of your document or UI element. An example of the Fonts dialog is shown in the following diagram. To change the font of your document or UI element 1. Click the property that you want to change. The property is then highlighted, enabling you to specify the required font attributes in the associated text boxes or combo boxes. 2. Make your change by overwriting the existing value in the text box, or selecting the required value in the combo box. For details about specific document and UI element properties, see the JADE Encyclopaedia of XAML Classes. Maintaining Grid Definitions Use the Grid Definition dialog, accessed by clicking the expand icon at the upper left of that dialog, to maintain the grid layout of XAML documents that are based on the following styles. Grid Based - Sizeable, Scrollable Grid Based - Fixed Size, Scrollable Grid Based - Fixed Size Child Window The grid is the most powerful of the layout managers. It is designed to be used for the layout of the user interface of your applications and is not intended for data display (for displaying data in a tabular fashion, you would typically use a XamlDataGrid). By default, a grid has one row and column. It is at its most useful when it contains multiple rows and columns in which the resulting cells manage the position and size of the child controls.

87 Chapter 3 Painting XAML Documents 87 The following diagram shows an example of the Grid Definition dialog. Key to the flexibility of the grid are the unit of measurement options that are available when defining width and height. These options are: Integer, where the value is defined in pixels Auto, where the size is determined by the size properties of the content object Asterisk (*), where the value is expressed as a weighted proportion of available space For details about defining a grid, see "Grid UI Element Type", in Chapter 4. For details about specific document and UI element properties, see the JADE Encyclopaedia of XAML Classes. Maintaining Miscellaneous Properties Use the Miscellaneous dialog of the Properties area, accessed by clicking the expand icon at the upper left of that dialog, to maintain miscellaneous properties of your document or UI element.

88 Chapter 3 Painting XAML Documents 88 The properties that you can maintain depend on the UI element that you select. The Miscellaneous dialog example shown in the following diagram is for a TextBox UI element. To maintain miscellaneous properties of your document or UI element 1. Click the property that you want to change. The property is then highlighted, enabling you to specify the required font attributes in the associated text boxes or combo boxes. 2. Make your change by overwriting the existing value in the text box, or by selecting the required value in the combo box. For details about specific document and UI element properties, see the JADE Encyclopaedia of XAML Classes. Maintaining Transformations Use the Transformations dialog of the Properties area, accessed by clicking the expand icon at the upper left of that dialog, to transform your document or UI element. For example, you can rotate a UI element by a specified number of degrees. An example of the Transformations dialog is shown in the following diagram.

89 Chapter 3 Painting XAML Documents 89 To transform your document or UI element 1. Click the property that you want to change. The property is then highlighted, enabling you to specify the required font attributes in the associated text boxes or combo boxes. 2. Make your change by overwriting the existing value in the text box, or by selecting the required value in the combo box. For details about specific document and UI element properties, see the JADE Encyclopaedia of XAML Classes. Defining Methods for Your Document To define methods to support your documents and UI elements, see the JADE Encyclopaedia of XAML Classes. Saving Your Document To save your XAML document, perform one of the following actions Select the Save command from the XAML menu. Press CTRL+S. For details, see "Saving Your Document", in Chapter 2. When you save your document in the XAML Painter, any single quote characters (') in the XAML are converted to the string &apos; when you view that document in the XAML Browser. Single quote characters are not allowed in the XAML Browser and must be replaced with the string &apos; so that the XAML remains valid. To save your XAML document under a different name Select the Save As command from the XAML menu. The Save Document-name as dialog is then displayed. For details, see "Saving Your Document as another Name", in Chapter 2. The Save As command is disabled if you have changed the document without saving it. After you save your changes, the Save As command is enabled. Editing an Existing Document in the XAML Painter To load an existing document so that you can maintain it Select the Edit command from the XAML menu of the Painter.

90 Chapter 3 Painting XAML Documents 90 The Edit Xaml Document dialog, shown in the following diagram, is then displayed to enable you to specify the name of the document that you want to load for editing. To load an existing document 1. From the text area of the Document combo box, specify the name of the document that you want to edit or select the document from the list box. The list box area of the Document combo box displays the XAML documents defined for the currently selected schema. 2. Click the OK button. Alternatively, click the Cancel button to abandon your selection. Using the Keyboard and Mouse to Edit Your Document When the selected document has been loaded, use combinations of keyboard and mouse actions to manipulate the UI elements on the document in the Painting area or edit the XAML directly on the XAML View sheet. You can also change details of a UI element or a group of UI elements by using the Properties dialog. For details, see "Maintaining Properties for Your XAML Document or UI Element", earlier in this chapter. For details about changing the type of an existing UI element (for example, changing a ComboBox UI element to a TextBox UI element), see "Changing a UI Element Type", later in this chapter. UI elements in the document are made visible and are enabled in the XAML Painter only if the settings of the IsHitTestvisible and the IsEnabled properties of each UI element are set to True. However, a UI element inherited from a superclass document is disabled, regardless of the setting of the IsEnabled property of that UI element on the current document. This provides you with a visual indicator in the XAML Painter that you cannot edit the UI element on the current document, as it belongs to the document of a superclass. Selecting Multiple UI Elements To select multiple UI elements in the Painting area Click on each UI element to be selected, while holding down the CTRL key. The first (master) element that you selected is highlighted with a red border. Subsequent selections have a green border. For details, see "Selecting a UI Element", earlier in this chapter.

91 Chapter 3 Painting XAML Documents 91 To deselect a UI element that is already selected While holding down the CTRL key, click on the UI element that you do not require in the selection. Changing the Size of Selected UI Elements To change the size of all selected UI elements Drag a side or a corner on the master UI element. Moving UI Elements around Your Document To move one or more selected UI elements around your document Drag the UI element or selected UI elements that you want to move. All selected UI elements move during the drag operation. If the UI element move lock operation is on (that is, you checked the Lock check box in the Options panel), you cannot move any UI elements. Notes You can select the base element of the document (typically the background or root element) but you cannot move it by dragging it. To move or resize a base element, use the Size and Position property dialog. When you add a UI element to a cell in a grid-based XAML document, its Margin property is set to 0,0,0,0. If you then drag that element to another part of the same cell, the XAML Painter sets the Margin property so that the element retains that position within the cell. This causes the underlying grid to change the size of the columns and rows: it does not affect the size of the document, only the grid layout. This behavior is a restriction of Silverlight that JADE is unable to change. Manually control the layout by setting the size of the columns and rows of the grid as required. For details, see "Grid UI Element Type", in Chapter 4. Copying UI Elements To copy a one or more selected UI elements that have the same parent Hold down the CTRL+ALT keys and then drag the selected UI element or UI elements to the new location on the document. Displaying the Properties for a UI Element To display the Properties for a UI element Select that UI element. For details, see "Selecting a UI Element", earlier in this chapter. The Properties area then displays details of the selected UI element. You can use the Properties area to change the UI element whose details are displayed, if required. That UI element then becomes the selected UI element on the document that you are editing. Placing a UI Element on a Container UI Element Container UI elements (for example, a canvas or stack panel) allow you to place other UI elements on top of them.

92 Chapter 3 Painting XAML Documents 92 To place a UI element on a container 1. Select the container element to which you want to add a child element. 2. Add the UI element as you would when adding a UI element to the document. For details, see "Adding UI Elements to Your Document", earlier in this chapter. A UI element that is positioned on a container UI element becomes a child UI element of the container, or parent, UI element. The position coordinates of a child UI element are always relative to its parent UI element. Child UI elements remain relative to the parent so that they move if the parent UI element moves. To change the parent of a UI element Select the parent in the Parent combo box in the General Properties dialog in the Properties area. Removing a UI Element from Your Document Before deleting one or more UI elements, ensure that you have selected the correct UI elements. You cannot delete a UI element that is inherited from a super document. If the selected UI element is not referenced in any JADE methods, it is unconditionally deleted. If the selected UI element is referenced by one or more JADE methods, a message box is displayed, as shown in the following diagram, after you try and save the document. Click the Yes button to confirm the deletion of the current UI element. Alternatively, click the No button to cancel the deletion request. To delete a UI element from a document Select the UI element that you want to delete and then press the DELETE key, or click the delete hyperlink in the options panel. Delete the relevant XAML code in the XAML View sheet and then click the Load XAML button. If you deleted the wrong UI elements and have not yet saved your changes, select the Refresh command in the XAML menu, to restore the document to the previously saved version. Changing a UI Element Type You can change the type of a UI element on a document, providing that the change does not break any rules regarding the UI element that can be the parent and the type of child UI elements that are permitted.

93 Chapter 3 Painting XAML Documents 93 The UI element name, event method code, and so on, are retained, so that you do not have to first delete the existing UI element, add the replacement UI element of the required type, and then create the appropriate event methods. To change the existing type of a UI element selected on a document Manually edit the XAML on the XAML View sheet. Note If you edit the XAML code directly, ensure that you are making valid changes. If you attempt to load invalid XAML, the XAML Painter may not be able to catch any exceptions raised by the Silverlight plug-in. In the worst case, Silverlight does not raise an exception that the XAML Painter can catch, it simply crashes and you must restart the XAML Painter. Effects of Editing an Existing Document If the document that you are editing is being used at run time, you are warned that the document cannot be saved until no user is using the document. If you try to save the edited document, the save action is disallowed until the document is not being used. When you access an existing document in the XAML Painter, you automatically lock the document class. Although locking a document prevents other users from making changes, they can view the unchanged document. When you exit from Painter, the lock is released. Deleting a Document Use the Delete command from the XAML menu to delete a document. To delete a document 1. Select the Delete command from the XAML menu. A message box is then displayed, prompting you to confirm that you want to delete the selected document. 2. Click the Yes button to delete the document. Alternatively, click the No button to abandon the deletion. Notes You cannot delete a document if the document has subclasses, any existing property references, or the document is open in the XAML Browser. When you delete a document, the corresponding class and all of its methods are deleted. Any methods referencing the deleted document are flagged as uncompiled. Layout Toolbar The buttons in the Layout toolbar enable you to size and align selected UI elements or groups of UI elements that have the same parent. The Layout toolbar is intended primarily for use with the Canvas UI element type. Before you align and space the UI elements on your document, you may want to make some elements identical in size; for example, button elements. You may also want to standardize the width or the height of other UI elements. The Layout toolbar buttons normally operate only on UI elements that are in the same container. Tip When laying out your document, standardize the size of UI elements before using the alignment and spacing layout buttons, as the size buttons can alter the spacing of your UI elements.

94 Chapter 3 Painting XAML Documents 94 The Layout toolbar buttons are listed in the following table. Toolbar Button Button Name Description Align Bottom Aligns to the bottom edge of the master UI element Align Top Aligns to the top edge of the master UI element Align Left Aligns to the left edge of the master UI element Align Right Aligns to the right edge of the master UI element Vertically Adjacent Makes the selected UI elements vertically adjacent Horizontally Adjacent Makes the selected UI elements horizontally adjacent Align Centers Horizontally Centers the selected UI elements horizontally Align Centers Vertically Centers the selected UI elements horizontally Space Evenly Down Spaces the selected UI elements evenly down the container Space Evenly Across Spaces the selected UI elements evenly across the container Same Height Makes all selected UI elements the same height Same Width Makes all selected UI elements the same width You cannot select the Align Bottom, Align Top, Align Left, Align Right, Vertically Adjacent, Horizontally Adjacent, Space Evenly Down, Space Evenly Across, Same Height, or Same Width button if you have not yet selected a group of UI elements (that is, they are disabled). To select a group of UI elements and assign a master UI element 1. Click the first UI element of your proposed group. 2. While holding down the CTRL key, click the other UI elements that are to be in your group. The first UI element that you select becomes the master UI element and all other elements are aligned or sized relative to the master UI element. For details, see "Selecting a UI Element", earlier in this chapter. Align Bottom Button Use the Align Bottom button in the Layout toolbar to align a group of UI elements so that the bottom edges of the selected UI elements are aligned with that of the master UI element. To align the bottom edges of the selected UI elements 1. Select the UI elements whose bottom edges you want to align. (Select the UI element with which you want to align the other elements first.)

95 Chapter 3 Painting XAML Documents Click the Align Bottom toolbar button. Align Top Button Use the Align Top button, in the Layout toolbar, to align a group of UI elements so that the top edges of the selected UI elements are aligned. To align the top edges of the selected UI elements 1. Select the UI elements whose top edges you want to align. (Select the UI element with which you want to align the other elements first.) 2. Click the Align Top toolbar button. Align Left Button Use the Align Left button in the Layout toolbar to align a group of UI elements so that the left edges of the selected UI elements are aligned. To align the left edges of your selected group of UI elements 1. Select the UI elements whose left edges you want to align. (Select the UI element with which you want to align the other elements first.) 2. Click the Align Left toolbar button. Align Right Button Use the Align Right button in the Layout toolbar to align a group of UI elements so that the right edges of the selected UI elements are aligned. To align the right edges of the selected UI elements 1. Select the UI elements whose right edges you want to align. (Select the UI element with which you want to align the other elements first.) 2. Click the Align Right toolbar button. Vertically Adjacent Button Use the Vertically Adjacent button in the Layout toolbar to align UI elements vertically. The highest UI element that you select does not move when the Vertically Adjacent button is clicked. All of the selected UI elements (except for the highest UI element) are moved upward. UI elements that are in different horizontal parts of the document are moved and they become adjacent along a vertical axis. To select this button from the Layout toolbar, you must first select a group of two or more UI elements. To make your selected UI elements vertically adjacent 1. Select the UI elements that you want to be vertically adjacent. 2. Click the Vertically Adjacent toolbar button.

96 Chapter 3 Painting XAML Documents 96 Horizontally Adjacent Button Use the Horizontally Adjacent button in the Layout toolbar to align UI elements horizontally. The UI element farthest to the left does not move when the Horizontally Adjacent button is clicked. All of the selected UI elements (except for the farthest left) are moved to the left. UI elements that are in different vertical parts of the document are moved and they become adjacent along a horizontal axis. To select this button from the Layout toolbar, you must first select a group of two or more UI elements. To make your selected UI elements horizontally adjacent 1. Select the UI elements that you want to be horizontally adjacent. (Select the UI element with which you want to align the other elements first.) 2. Click the Horizontally Adjacent toolbar button. Align Centers Vertically Button Use the Align Centers Vertically button in the Layout toolbar to center a UI element or group of UI elements relative to the vertical axis of your document or container UI element. To center the selected UI elements vertically 1. Select the UI elements that you want to center vertically. 2. Click the Align Centers Vertically toolbar button. The selected UI elements do not move relative to each other. If you select one UI element only, it centers only that UI element. Align Centers Horizontally Button Use the Align Centers Horizontally button in the Layout toolbar to center a UI element or group of UI elements relative to the horizontal axis of your document or container UI element. To center the selected UI elements horizontally 1. Select the UI elements that you want to center horizontally. 2. Click the Align Centers Horizontally toolbar button. The selected UI elements do not move relative to each other. If you select one UI element only, it centers only that UI element. Space Evenly Down Button Use the Space Evenly Down button in the Layout toolbar to space a group of UI elements so that the vertical distance between each UI element is the same. The Space Evenly Down toolbar spreads the selected UI elements evenly down the whole document or container.

97 Chapter 3 Painting XAML Documents 97 To space the UI elements evenly down the document or container 1. Select the UI elements that you want to space evenly down the document or container. 2. Click the Space Evenly Down toolbar button. Space Evenly Across Button Use the Space Evenly Across button in the Layout toolbar to space a group of UI elements so that the horizontal distance between each UI element is the same. The Space Evenly Across toolbar spreads the selected UI elements evenly down the whole document or container. To space the UI elements evenly across the document or container 1. Select the UI elements that you want to space evenly down the document or container. 2. Click the Space Evenly Across toolbar button. Same Width Button Use the Same Width button in the Layout toolbar to standardize the width of two or more selected UI elements. The UI elements that you select are assigned a width equal to the selected master UI element. Width truncation or extension is performed from the right. To standardize the width of the selected UI elements 1. Select the UI elements that you want to make the same width. (Select the UI element with which you want to standardize the widths of the other elements first.) 2. Click the Same Width toolbar button. Same Height Button Use the Same Height button in the Layout toolbar to standardize the height of two or more selected UI elements. The UI elements that you select are assigned a height equal to the selected master UI element. Height truncation or extension is from the bottom. To standardize the height of the selected UI elements 1. Select the UI elements that you want to space evenly down the document or container. (Select the UI element with which you want to standardize the heights of the other elements first.) 2. Click the Same Height toolbar button.

98 Chapter 4 Considerations When Developing Silverlight Applications This chapter covers the following topics. Using Third-Party Controls Third-Party Control Usage in JADE Silverlight Stateful Applications Third-Party Control Usage in JADE Silverlight Stateless Applications Abstract Classes and Third-Party Controls Accessing.NET Objects Accessing Silverlight Fields and Properties Accessing Silverlight Methods Specifying a Type Enums Using Layout Manager UI Element Types Canvas UI Element Type StackPanel UI Element Type Grid UI Element Type Using Resources in XAML Documents Creating Controls Dynamically or from a Template Use of the itemssource Property by Different XAML Classes XamlSelector and XamlDataGrid Class Use of the itemssource Property XamlAutoCompleteBox Use of the itemssource Property Unit Testing Silverlight Applications Adding Silverlight Unit Tests to the JADE Unit Testing Framework Running the Silverlight Application Unit Tests Using Third-Party Controls This section describes how to use third-party controls in your JADE Silverlight stateful and stateless applications. Third-Party Control Usage in JADE Silverlight Stateless Applications The examples in this section use the ButtonSpinner control from the Microsoft Silverlight toolkit.

99 Chapter 4 Considerations When Developing Silverlight Applications 99 Before the XAML that contains the control can be used, the DLLs defining the control must be available for JADE. You can place these DLLs in one of the following locations. The bin directory of your application server. In a folder that is referred to by the DefaultAssemblyLocation parameter in the [JadeSilverlight] section of the JADE initialization file. To use the controls in your XAML, you must add the correct namespace declaration at the end of the opening element of your XAML; for example, add the following to the end of the first element of the XAML. <...xmlns:controlstoolkit="clrnamespace:system.windows.controls;assembly=system.windows.controls.toolkit"...> The ButtonSpinner control can then be used from this assembly, by adding a control element; for example: <toolkit:buttonspinner Name="spinner" Height="40" Width="100" Content="50" FontSize="16 "/> When the XAML is saved, in the XamlDocument subclass (created for the XAML), you will find a reference of type XamlObject, with the name specified in the control element (in this case, spinner) that is the JADE reference to the control. You can use this reference to access properties and call methods of the control. You can use the XamlObject class setxamlproperty, getxamlproperty, invokexamlmethod, and invokexamlmethodio methods to manipulate the control object; for example, to access the properties and methods of the event arguments. To determine what is available, consult the documentation of the third-party control. To receive events from the controls, use the XamlDocument class registereventhandler method to register for event notification. Using the ButtonSpinner in the previous example, call the registereventhandler method to register for the "Spin" event; for example: registereventhandler(spinner, "Spin", ThirdPartyControls::spinnerSpun); The first parameter indicates the control with which we are working, the second is the event name of the control, and the last parameter is the JADE method that will be called when this event is triggered. The JADE method that handles the event (the event handler method) must have the following signature. (sender:xamlobject input; eventargs:xamlobject) browserexecution; The following example of an event handler for a button spinner also demonstrates the use of the getpropertyvalue and setpropertyvalue methods. spinnerspun(control XamlObject input; eventargs:xamlobject) browserexecution; vars i : Integer; spindirection : String; begin spindirection := eventargs.getxamlproperty("direction").string i := control.getxamlproperty("content").integer; if spindirection = "Increase" then i := i+1; else i := i-1; endif; control.setxamlproperty("content", i); end;

100 Chapter 4 Considerations When Developing Silverlight Applications 100 The Silverlight controls implemented in JADE are built on controls that are available in standard Silverlight. The supporting Silverlight DLLs contain many more controls than those exposed by JADE. The other controls in these DLLs can also be accessed in a similar way to that described in this section. However, for controls not exposed by JADE, you do not have to place a copy of the DLL in the JADE bin directory or default assembly location, as JADE will already know how to find these. Depending on the control that you use, it may be unnecessary to include a namespace declaration. registereventhandler Method for DataTemplate Controls To generically handle the XamlDocument class registereventhandler method for controls defined in a DataTemplate: When you save a document, any third-party controls are investigated to determine where they fit in the JADE XamlObject hierarchy. (These controls are not generated as a XamlObject-type property.) When you save a document, the assemblies for that control are referenced to determine whether the control inherits from a JadeXamlControl type; for example, the RadComboBox in the Telerik Controls assembly inherits from XamlItemsControl. As a result, the property associated with that control is created as a XamlItemsControl. This also means that the control can be referenced via the property, as that type and the events associated with that control type can be directly defined rather than having to call the XamlDocument class registereventhandler method. Note Any assemblies required must be located in the directory associated with the DefaultAssemblyLocation parameter in the [JadeSilverlight] section of the JADE initialization file. If the required assemblies cannot be found, a message box advises you of the failure and asks if you want to display the details in an exception dialog. The exception dialog lists the assembly that could not be found. A named item in a DataTemplate is generated as a virtual property of the defined type, which enables you to directly define events in JADE. However, because it is virtual, any logic references will be rejected by the JADE compiler. This is deliberate, because at run time, the template can be used multiple times to generate different instances of the control that all have the same name. When an event occurs on one of these controls, the first parameter of the event is the control instance, which can then be referenced in logic. For third-party controls used that are named and can be defined as a XamlUIElement subclass, you can define events not available in JADE by performing the following actions. 1. Define an event handler method for the event. In the following example, the source type matches the type of the control property. radcombo_selectionchanged(source: XamlItemsControl input; origin: XamlObject input); 2. Define a loaded event on the control in JADE that does the following (where the source type matches the type of the control property). radcombo_loaded(control: XamlItemsControl input; originalsource: XamlObject input); begin if control.tag <> "Done" then // The loaded event for a control // can be called multiple times if // the control is hidden and then // made visible, for example.

101 Chapter 4 Considerations When Developing Silverlight Applications 101 self.registereventhandler(source, "SelectionChanged", xaml-document-name::radcombo_selectionchanged); control.tag := "Done"; endif; endif; This logic will then register that event for every instance of the DataTemplate item that is created. Third-Party Control Usage in JADE Silverlight Stateful Applications This section describes how to use third-party controls (or Silverlight controls not exposed by JADE) in your JADE Silverlight stateful applications. The following examples use the Expander control from the Microsoft Silverlight toolkit. The JADE Silverlight runtime JadeAGL needs to be given the assembly (or assemblies) that define the control. To use these controls, the associated assemblies must be available to the application server for downloading to the XAML Painter. Before loading the XAML that contains the control, call the XamlManager class loadassembly or loadassemblyfrombinary method to pass the assembly on to JadeAGL, as follows. app.xamlmanager.loadassembly("system.windows.controls.toolkit.dll"); You must add valid XAML that uses the control directly into the XAML editing area of the XAML Browser or XAML Painter. You cannot use the Painting area of the XAML Painter to add these controls, as it does not know about them. To use the third-party control in your XAML, perform the following actions. 1. Add the correct namespace declaration at the end of the first element of your XAML, if the namespace of the control is not already included; for example: <...xmlns:controlstoolkit="clrnamespace:system.windows.controls;assembly=system.windows.controls.toolkit"...> 2. Insert valid XAML at the required location in your XAML; for example: <controlstoolkit:expander HorizontalContentAlignment="Center"> <controlstoolkit:headeredcontentcontrol.header> <TextBlock Text="Your Stickfigure life" FontSize="18"/> </controlstoolkit:headeredcontentcontrol.header> <controlstoolkit:headeredcontentcontrol.content> <Button Content="Button1"/> </controlstoolkit:headeredcontentcontrol.content> </controlstoolkit:expander> You should now be able to run the XAML application in the usual way and find a functioning external control on that document. Manipulate the Silverlight control object by calling the XamlObject class setxamlproperty, getxamlproperty, invokexamlmethod, and invokexamlmethodio methods. Abstract Classes and Third-Party Controls Brush, Geometry, Panel, RangeBase, Selector, Shape, Transform, and UIElement are abstract classes in Silverlight but they are not abstract in the JADE XAML framework. If you import a third-party Silverlight control that is a subclass of one of those classes, the representation of this control is an instance of one of these abstract Silverlight classes. These classes are therefore not abstract in the RootSchema; that is, there might be real instances of them.

102 Chapter 4 Considerations When Developing Silverlight Applications 102 You cannot create instances by user logic for these classes because this results in an exception. Accessing.NET Objects The XamlObject class provides the following methods that support access to underlying.net objects, usually defined in third-party DLLs. getxamlproperty setxamlproperty invokexamlmethod invokexamlmethodio These methods are called on a JADE object that is acting as a proxy for a.net or Silverlight object. The first parameter of these methods specifies the member of the underlying.net object that is to be accessed or invoked. Accessing Silverlight Fields and Properties Call the XamlObject class getxamlproperty and setxamlproperty methods to access Silverlight fields and properties. The first parameter of each method specifies the name of the field or property of the current.net object being accessed. To access a static type that is not the type of the current.net object, see "Specifying a Type", later in this chapter. Enumerated (enum) type values are passed as strings. The string value passed is one that matches the string constant of the enum value. For details, see "Enums", later in this chapter. Accessing Silverlight Methods Call the invokexamlmethod or invokexamlmethodio method to access a Silverlight method. The first parameter of each method specifies the name of the method of the current.net object being invoked. If the.net method being invoked has: No parameters or input parameters only, use the invokexamlmethod method. or output parameters, you must use the invokexamlmethodio method. To access a static method on a type that is not the type of the current.net object, see "Specifying a Type", later in this chapter. Enum values are passed as strings. The string value passed is one that matches the string constant of the enum value. For details, see "Enums", later in this chapter. Overloaded.NET Methods If the.net method is overloaded, the first parameter must also specify the arguments of the method, to identify the correct method to invoke, as shown in the following examples. invokexamlmethod("mth(int32)", arg); invokexamlmethod("mth(system.int32)", arg);

103 Chapter 4 Considerations When Developing Silverlight Applications 103 Prefix the types in the method with ref (for reference parameters) or out (for output parameters), as appropriate, as shown in the following example. invokexamlmethod("mth(ref Int32; out Int32)", arg1, arg2); If you specify more than one parameter in a method, separate each parameter with a semicolon character, as shown in the previous example. Types from the system namespace do not need to specify their namespace. Other types, however, must be an assembly-qualified name, as shown in the following example. For details, see "Specifying a Type", later in this chapter. invokexamlmethod(("mth(" & aqn & ")").StringUtf8, arg); Note In the previous example, aqn is an assembly-qualified name of the parameter type. Constructors Constructors can be called by specifying the special method name.ctor, which must be prefixed by the type of the object being constructed, as shown in the following example. For details, see "Specifying a Type", later in this chapter. invokexamlmethod((aqn&";.ctor").stringutf8); Overloaded constructors are called in the same way as normal overloaded methods, as shown in the following example. invokexamlmethod((aqn&";.ctor(int32)").stringutf8, 64); Note In the previous example, aqn is an assembly-qualified name of the parameter type. Specifying a Type Enums When it is necessary to specify the type for static member access or for method parameter specification, a fullyqualified name is required. The fully-qualified name is defined in.net and must conform to the.net expectations. It has the following format. <namespace-name>.<type-name>,<assembly-display-name> For more details, see your.net documentation. If you specify a fully-qualified name in the getxamlproperty, setxamlproperty, invokexamlmethod, or invokexamlmethodio method, separate the type and member with a semicolon character, as shown in the following example. invokexamlmethod((aqn&";.ctor").stringutf8); Enums are passed between.net and JADE as strings. The string value corresponds to the name of the constant defined in the.net enum. For example, where the property MyProp is of type Days, the: C# enum definition is as follows. public enum Days {

104 Chapter 4 Considerations When Developing Silverlight Applications 104 Saturday, Sunday, Monday, Tuesday, Wednesday, Thursday, Friday }; Corresponding JADE enum access code is as follows. setxamlproperty("myprop", "Monday"); getxamlproperty("myprop"); If the enum is a flags type (that is, it has the FlagsAttribute attribute), multiple values can be set by providing a comma-separated list. For example, where the property MyProp is of type Direction, the: C# enum definition is as follows. public enum AllowedDirection { None = 0x0, Up = 0x1, Down = 0x2, Left = 0x4, Right = 0x8 } Corresponding JADE enum access code is as follows. setxamlproperty("myprop", "Up, Down"); Using Layout Manager UI Element Types The Canvas, StackPanel, and Grid UI elements are types of Panel, which is a layout manager type of UI element. Panels are designed to hold multiple UI elements. The layout of UI elements within the Panel depends on the type of Panel, as each Panel type exerts its own layout requirements on the UI elements it contains. Note Layout managers can contain other layout managers; for example, a canvas can contain a grid, and so on. This section covers the following layout managers. Canvas StackPanel Grid The following table summarizes the differences and similarities between the layout manager types. Canvas StackPanel Grid Grid-based layout? No No Yes Child elements added At upper left In the next available stack position In specified grid cell Child elements can be No No Yes resized automatically? Child elements can overlap? Yes No Yes Uses zindex? Yes No No For details, see the following subsections.

105 Chapter 4 Considerations When Developing Silverlight Applications 105 Canvas UI Element Type The Canvas is the most simple of the layout managers, and is considered a layout manager only because the children you position on it move with the Canvas. The Canvas parent does not exert any influence over the size of its children if it is resized. In addition, children can overlap and be placed outside or extend beyond the boundaries of the parent (the children always move relative to the Canvas if the parent is moved). In addition, the Layout toolbar and check boxes in the Options panel are intended primarily for use with children on the Canvas UI element. For details, see "Defining the Layout of Your XAML Document" and "Options Panel Check Boxes", in Chapter 3. An additional attribute, the zindex, is unique to UI elements that are placed on a Canvas. The zindex value determines which UI element sits visually on top of another if both occupy the same place or overlap on the Canvas. The UI element with the larger zindex value is displayed on top. The default zindex value is zero (0) and all children are added at the upper-left corner of the Canvas. In the XAML code, the ZIndex is called an attached property, and is written as shown in the following example. <Canvas.../> <Button...Canvas.Left="30" Canvas.Top="30" Canvas.ZIndex="20" Width="20" Height="30"/> <Button...Canvas.Left="10" Canvas.Top="15" Canvas.ZIndex="10" Width="100" Height="50"/> In the previous example, the first button is smaller than the second one, and without a ZIndex it would be obscured. However, setting its ZIndex to a higher value than the second button means that it is displayed on top of the bigger button. StackPanel UI Element Type The StackPanel is a layout manager that arranges child elements into a single line, which can be horizontal or vertical. The StackPanel is not a grid-based layout manager. Child elements are stacked vertically or horizontally as they are added to the StackPanel. UI elements move with the StackPanel parent but as a general rule are not resized if the parent is resized. Note To get a UI element to always fill the width of the StackPanel, select that UI element, select the Stretch item in the HorizontalAlignment combo box, and then enter NaN in the Width text box in the Size and Position dialog.

106 Chapter 4 Considerations When Developing Silverlight Applications 106 The order in which UI elements are displayed in the StackPanel is primarily determined by the order in which they are added, as shown in the following diagram (on the left) for which the corresponding XAML is displayed (on the right). Although you can alter the position of a child UI element by manipulating the margins of a container to push the UI element outside of its natural flow, it is more common to reposition the control in relation to the other controls contained in the StackPanel. To change the order of a UI element in the Painting area, select the UI element and drag it to the required relative position in the stack. In the example in the following diagram, Button_3 has been selected and dragged out beyond the bottom of the last item in the stack in the previous diagram. You can drop a UI element at any position within the stack. Controls in a StackPanel cannot overlap, however. Each control occupies a position in the stack relative to its neighboring controls. Grid UI Element Type The Grid UI element is a grid-based layout manager. Within the Grid UI element, you can define a grid, which can be used resize the child elements automatically. The Grid has its own properties dialog, Grid Definition, which is displayed when the Grid has focus. By default, a grid has one row and column. It is at its most useful when it contains multiple rows and columns in which the resulting cells manage the position and size of the child controls.

107 Chapter 4 Considerations When Developing Silverlight Applications 107 The left of the following diagram shows an example of the Grid Definition dialog in the Property area of the XAML Painter and at the right is an example of some Button controls and a GridSplitter positioned within the Painter area. Key to the flexibility of the grid are the unit of measurement options that are available when defining width and height. These options are: Integer, where the value is defined in pixels Auto, where the size is determined by the size properties of the content object Asterisk (*), where the value is expressed as a weighted proportion of available space In the example in the previous diagram, the first column (that is, column 0) is 80 pixels wide, the third column (that is, column 2) is as wide as any content added to that column (in the previous example, a GridSplitter has been added), and the second and fourth columns divide the remaining space evenly between themselves. If the grid gets resized, the first column will remain 80 pixels wide, the column containing the grid splitter will remain the same size (as the grid splitter width has been fixed) and the remaining columns adjust their size accordingly. The previous diagram also shows the interaction between a grid and its child controls. By removing the height and width properties from the buttons, and the grid splitter, the grid becomes responsible for performing layout and sizing of the controls. You can also manipulate the grid properties by using the grid assistant. For details, see "Using the Grid Assistant", in the following subsection.

108 Chapter 4 Considerations When Developing Silverlight Applications 108 The following Size and Position dialog settings were used for the buttons in the previous diagram. Button_1 has no defined width, deferring its width to be that of the first column. A defined height of 40 pixels and VerticalAlignment of Center positions the button with equal spacing top and bottom within the grid cell. Button_2 has no defined width (like Button_1), but is a different size because it is set up to span two columns in the Grid.ColumnSpan text box. Although the first column (and therefore Button_1) has a fixed width, the width of the second column is proportional to the grid size. This means that the width of Button_2 changes accordingly if the grid resizes.

109 Chapter 4 Considerations When Developing Silverlight Applications 109 Button_3 has no defined height. This would typically size the button to be not much taller than its content (that is, the caption). In this example, however, the VerticalAlignment text box has been set to Stretch, which causes the button to stretch to fill the available space. Button_4 has a specified width and height. The HorizontalAligment and VerticleAlignment values mean that Button_4 is positioned in the middle of the grid cell.

110 Chapter 4 Considerations When Developing Silverlight Applications 110 The GridSplitter has no defined height but has a defined width of 10 pixels. It has been placed into a column to which automatic sizing applies; that is, the width of the column is determined by the width of its children. The Grid.RowSpan property specifies that the GridSplitter should stretch over all rows in the grid and the VerticalAlignment value specifies that the splitter is to take all available vertical space. Using the Grid Assistant When you maintain the Grid UI element type, you can use the grid assistant in the Painting area in addition to the Grid Definition dialog, to manipulate the columns and rows in the grid. To display the grid assistant 1. In the Painting area, select the Grid UI element on your document. For details, see "Selecting a UI Element", in Chapter Right-click and then select the Show Grid Assistant command from the popup menu that is displayed.

111 Chapter 4 Considerations When Developing Silverlight Applications 111 The grid assistant is then displayed, as shown in the following diagram. To hide the grid assistant, press ESC twice. Column and row properties are displayed across the top and down the left of the grid assistant, respectively. The width of each column, as recorded in the Grid Definition area, is displayed at the top of each column in the grid assistant. The height of each row, as recorded in the Grid Definition area, is displayed at the left of each row in the grid assistant. To adjust the width or height of a column or row, drag the blue triangle to the required position. (Your cursor becomes a double-headed arrow when you position it over a blue triangle.) The width or height of the adjacent column or row is adjusted accordingly and the values in the Grid Definition area are updated. When you select a column or row in the grid assistant, that column or row is highlighted with a red line and a tab indicates whether the width or height is: Determined automatically by the column or row contents; that is, A is highlighted in the tab Fixed; that is, 12 is highlighted in the tab Weighted proportion; that is, S is highlighted in the tab

112 Chapter 4 Considerations When Developing Silverlight Applications 112 The following diagram shows an example of a column whose width is a weighted proportion. Grid Assistant Popup Menu The grid assistant has a popup menu, unique to the grid assistant, that enables you to maintain rows and columns in the Grid UI element. The commands that are available depend on whether you select one or more rows or columns. The following table lists the commands that could be displayed when you right-click in the grid assistant. Command Insert New Column Insert New Row Insert New Column Splitter Insert New Row Splitter Delete Column Delete Row Make All Items AUTO Make Selected Items AUTO Resize Items to Fill Selected Space Select this command to Insert a new column. This action splits the current column at the position of your cursor. Insert a new row. This action splits the current row at the position of your cursor. Insert a column splitter at the left of the selected column. At run time, users can use the splitter to control the width of the column. Insert a row splitter at the top of the selected row. At run time, users can use the splitter to control the height of the row. Delete the selected column or column splitter. You can delete one column at a time. Delete the selected row or row splitter. You can delete one row at a time. Set the width of all columns or rows in the grid to automatic; that is, the width or height is determined automatically by the column or row contents. If the column or row has no content, it collapses to zero width and is not visible in the Painting area. Set the width of the selected items in a row or column to automatic; that is, the width or height is determined automatically by the column or row contents. If the column or row has no content, it collapses to zero width and is not visible in the Painting area. Resize the selected items so that they are evenly spaced.

113 Chapter 4 Considerations When Developing Silverlight Applications 113 Command Resize Items to Primary Size Select this command to Resize the selected items to the same width or height as the primary selected row or column. Using Resources in XAML Documents You can define Resource sections in your XAML documents. Resources can be used multiple times within a document and reusing them can help you to achieve a consistent look and feel throughout your application and may improve its performance over the Internet. Examples of resources include Styles, ControlTemplates, Brushes, or DataTemplates. A style is a collection of property setters that define property values, which differ from the default value for a Silverlight class. These styles, defined as resources, can be assigned to Silverlight components and all defined properties from the style are going to apply for the component. Styles are enclosed within the <Style> and </Style> tags, as shown in the following example. The code in the previous example contains two styles. One style applies to all text boxes in the XAML document and another style that applies to all list boxes. Both of the styles in the previous examples make the UI elements appear in blue. A control template defines the appearance of a Silverlight control and how it changes its appearance if it changes its state. These control templates, defined as resources, can be assigned to Silverlight components and all defined properties from the template are going to apply for the component. Control templates are enclosed within the <ControlTemplate> and </ControlTemplate> tags.

114 Chapter 4 Considerations When Developing Silverlight Applications 114 The following XAML code is an example of a control template that defines the look of ContentControl UI elements in a XAML document. This control template is used in every XAML document and does not define any animations for user interaction. It is responsible for the gray partially transparent frames that split the UI of every document into different parts. For details about other Silverlight resources, see your Silverlight documentation. Additional details are available from the following URL. Creating Controls Dynamically or from a Template The JADE XAML framework supports dynamic creation of objects of all new classes, except for the abstract classes mentioned under "Abstract Classes and Third-Party Controls", earlier in this chapter. Dynamic control creation can be used to create items for ItemsControl instances and to populate them. However, this can impact on your system performance for Silverlight stateful applications, as described in the following example. An item of an ItemsControl contains 10 visual elements and there are 15 different properties to set on each element by user logic. In Silverlight stateful applications, this results in 25 potential application server calls to the presentation client. Note In Silverlight stateless applications, there is no traffic to and from the application server. There might be also 20 elements to add as child elements of this ItemsControl instance so there are 20 x 25 = 500 potential calls from the application server to the presentation client. The application performs well using a local area network but not well using the Internet. displayallpeople(personcollection: PersonArray); vars person: Person; image: XamlImage; panel: XamlStackPanel; textblock: XamlTextBlock; begin foreach person in PersonArray do create image; create panel; create textblock; textblock.text := person.name.stringutf8;

115 Chapter 4 Considerations When Developing Silverlight Applications 115 image.setsource(person.photo); panel.children.add(image); panel.children.add(textblock); mylistbox.additem(panel); endforeach; end; The solution for this specific problem is to use templates to create the items. An ItemsControl template is a piece of XAML that is attached to the control and defines how each item is to look at run time. The visual components used to create an item are likely to be identical for each item and they are populated with a different set of data. A template, defined in the document XAML of the control, can contain the description of how an item looks and also contains the data binding for each item. For example, it might contain a TextBlock where the text property is bound to a JADE property of a data item. These data items are instances of JADE classes and contain public primitive properties. All of these properties can be bound against properties of elements that are used inside the template. XAML: <ListBox x:name="mylistbox" Width="200" Height="400"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <Image ImageSource="{Binding-photo}" /> <TextBlock Text="{Binding-name}" /> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> </ListBox> The itemssource property of the ItemsControl class is used to send an assigned collection of data items to the presentation client. The data items are serialized and the bound property values are displayed. An example of using the itemssource property is shown in the following code. displayallpeople(personcollection: PersonArray); begin <mylistbox.itemssource := personcollection; end; Use of the itemssource Property by Different XAML Classes The XamlSelector and XamlDataGrid classes use the itemssource property in a different way from the XamlAutoComplete class, as described in the following subsections. XamlSelector and XamlDataGrid Class Use of the itemssource Property The XamlComboBox and XamlListBox classes are subclasses of the XamlSelector class, which defines how to populate its subclasses. To populate combo box and list box controls in the classical user interface, use the: additem method, to add strings to the controls, as shown in the following example. mylistbox.additem("grapes"); mylistbox.additem("apples");

116 Chapter 4 Considerations When Developing Silverlight Applications 116 mycombobox.additem("new Zealand"); mycombobox.additem("paraguay"); JADE XAML enables you to add more-complex objects than strings to these controls. Any UI element can be added as an item to a Selector instance, including complex visual trees that contain other visual elements, as shown in the following example. mylistbox.additem(myxamlimage); myborder.child := mytextblock; mylistbox.additem(myborder); displaycollection method, to display a whole collection of items in the controls. In the JADE XAML framework, the XamlSelector class and the XamlDataGrid class contain the itemssource property. When a collection is assigned to this property, the collection entries are displayed as items of these controls; for example, if a collection of strings is assigned to the itemssource property of a XamlListBox, the strings are displayed as the items of the XamlListBox. There are some differences between how the classical interface and the JADE XAML framework display collections in their controls. If the collection used is updated by using the classical user interface, the changes are displayed in the GUI. In the JADE XAML framework, the changes are not displayed in the GUI and there needs to be another assignment to the itemssource property so that the changes are displayed. The classical user interface can handle a very large collection. This does not perform well using the itemssource property in the JADE XAML framework because the whole assigned collection is serialized and sent to the presentation client every time a collection is assigned to the itemssource property. The collection assigned to the itemssource property does not necessarily need to contain strings; it also can contain JADE objects, the primitive properties of which can be used to display the content of an item of these controls. For example, DataGrid columns can be bound to JADE object properties and the Selector instances can contain templates of visual elements where visual elements are bound to the properties of these JADE objects, as shown in the following example. displaytwopeople(personone: Person; persontwo: Person); begin personcollection.add(personone); personcollection.add(persontwo); mydatagrid.columns[1]. XamlDataGridTextColumn.binding :=Person.name; mydatagrid.columns[2]. XamlDataGridTextColumn.binding :=Person.address; mydatagrid.itemssource := personcollection; end; XamlAutoCompleteBox Use of the itemssource Property The itemssource property of the XamlAutoCompleteBox subclass is different from the itemssource property of a XamlSelector or XamlDataGrid class. An AutoCompleteBox looks like a TextBox but works like a text-based ComboBox. At run time, users enter text into the AutoCompleteBox as they would into a TextBox, but while typing, suggestions are displayed in a popup underneath the entry field. The user can use the arrow keys or the mouse to select one of the suggestions, like using a ComboBox, and the selected item is then displayed in the TextBox. Use the itemssource property, to assign a collection of strings that are the suggestions that populate the popup of the AutoCompleteBox. You cannot add any visual items other than strings to the AutoCompleteBox; that is, the AutoCompleteBox is text-based only.

117 Chapter 4 Considerations When Developing Silverlight Applications 117 Unit Testing Silverlight Applications The JADE unit testing framework supports unit testing of classes and methods in stateful and stateless Silverlight applications. This section describes how to create and run unit tests for Silverlight applications. For details about the JADE unit testing framework, see Chapter 22 of the JADE Developer s. Adding Silverlight Unit Tests to the JADE Unit Testing Framework To add Silverlight unit tests to the JADE unit testing framework 1. Add your test classes as subclasses of the JadeTestCase class (as you would in JADE). An example of the JadeTestCase class hierarchy is shown in the following diagram.

118 Chapter 4 Considerations When Developing Silverlight Applications Add unit test methods to the classes that you added in step 1 of this instruction. The following code is an example of a unit test method. Note Include unittest in the method signature as you would for JADE unit tests. The method in the previous example includes browserexecution in the signature to test it under Silverlight stateless. 3. If the method does not depend on Silverlight, press F9 to run it directly from the JADE development environment. The Unit Test Runner dialog, shown in the following diagram, then displays the results for the unit test the Results list box. If the method does depend on Silverlight, you must additionally define the Silverlight application before you can run the unit tests. For details, see the following subsections.

119 Chapter 4 Considerations When Developing Silverlight Applications 119 Configuring a Silverlight Stateful Application to Run Unit Tests To configure a Silverlight stateful application to run unit tests 1. Use the Define Application dialog to define a (stateful) Silverlight application that has the following parameters. In the: a. Application Type combo box, specify the Silverlight item. b. Startup Xaml combo box, specify the JadeTestDocument class (from the RootSchema). An example of the Define Application dialog is shown in the following diagram. For details, see "Defining a Silverlight Application", in Chapter Run the Silverlight application. For details, see "Running a JADE Silverlight Stateful Application", in Chapter 1. When you run the application, the browser in which the Silverlight application is running displays all of the test classes and test methods available. For details, see "Running the Silverlight Application Unit Tests", later in this chapter. Configuring a Silverlight Stateless Application to Run Unit Tests To configure a Silverlight stateless application to run unit tests 1. Use the Define Application dialog to define a (stateless) Silverlight application that has the following parameters. In the: a. Application Type combo box, specify the Silverlight Stateless, Gui or the Silverlight Stateless, Non-GUI item.

120 Chapter 4 Considerations When Developing Silverlight Applications 120 b. Startup Xaml combo box, specify the JadeTestDocument class (from the RootSchema). An example of the Define Application dialog is shown in the following diagram. 2. Generate the XAP file. For details, see "Generating XAP and HTML Files", in Chapter Run the Silverlight stateless application. For details, see "Running a Silverlight Stateless Application", in Chapter Navigate to the relevant HTML page in your browser. The browser should look the same as for the Silverlight stateful unit test. The only differences are that the: Unit tests are running in the browser rather than on the application server. Stack traces of failed tests display offset values from the start of the Microsoft Intermediate Language (MSIL) code for the method that is executing (instead of displaying the standard JADE method source offsets). The unit testing framework is especially useful for checking that webserverexecution methods are working correctly. Because the only classes that can be involved in webserverexecution methods are those below the XamlDataObject class in the XAML hierarchy, one approach is to call the webserverexecution method from a unit test and then check that the correct values are returned. Alternatively, the code may pass a reference to the test, to enable the checks to be made.

121 Chapter 4 Considerations When Developing Silverlight Applications 121 Running the Silverlight Application Unit Tests When you run the application, the browser in which the Silverlight application is running displays all of the test classes and test methods available, as shown in the following diagram. Test classes are listed in the Select Tests pane, at the left of your browser. Classes and subclasses are displayed in bold text and the hierarchy of the class structure is visible, which you can collapse and expand, as required. Test methods are displayed under their defining class (they could be displayed in italicized type). The Run all tests item, in the Select Tests pane, is selected by default. Click the Run button, to run all of the tests for the classes that are listed in the Select Tests pane. The test results are then displayed in the Results table and use the following color coding. Passed tests are displayed in green Failed tests are displayed in red Ignored tests (that is, tests with unittestignore rather than unittest in their method signature) are displayed in yellow

122 Chapter 4 Considerations When Developing Silverlight Applications 122 An example of test results displayed in the Results table is shown in the following diagram. The test results do not update the progress bar while they run because the Silverlight process does not refresh the browser. The test results, therefore, are displayed only when all of the tests have finished running. If you select a class in the Select Tests pane before you click the Run button, all of the tests for that class and its subclasses are run. If you select a method for a class and then click the Run button, that test only is run. Viewing Failed and Ignored Tests To display only failed and ignored tests in the Results table Check the Hide Passed Tests check box, under the Results table, and then run the tests.

123 Chapter 4 Considerations When Developing Silverlight Applications 123 The Results table then displays only failed and ignored tests, as shown in the following diagram. To view the stack trace of a failed test, click on the failed status of that test, in the Item column of the Results table. The Call stack dialog, shown in the following diagram, then displays the stack trace details.

124 Chapter 4 Considerations When Developing Silverlight Applications 124 The values in parentheses are the JADE code positions where the failure occurred for a Silverlight stateful application unit test. (If the unit test was for a Silverlight stateless application, the values in parentheses are MSIL code offset values and the error position is not easily determined.) Use the Find Position in Method Source dialog, shown in the following diagram, to locate the code. Access the Find Position in Method Source dialog by selecting the Find Code Position command from the Methods menu. For details, see Chapter 4 of the JADE Development Environment User s Guide. Alternatively, check the Debug on: Assert check box, to display a dialog that specifies the stack trace as each failure occurs. Testing the Behavior of Silverlight UI Elements The right side of your unit test browser (the scratchpad) can display XAML documents and their UI Elements. For example, if the schema you are testing has a document named TestDocument that has a XamlButton (named btnclickme) and a XamlCalendar (named calendar_1) on a grid with two columns and two rows, the following diagram is an example of what is displayed in the right side of your browser when you run the application.

125 Chapter 4 Considerations When Developing Silverlight Applications 125 If you click the Click Me button, the following code is executed. The code in the previous example causes the text on the button to toggle between normal type and bold italicized type, as shown in the following diagrams. To test the behavior of the button, using the unit test framework 1. Add a class under the JadeTestCase class. 2. Add a testdocument reference of type TestDocument to the class and initialize it before each test on the class is run, by using a method that includes unittestbeforeclass in its signature, as shown in the following diagram. The code in the previous diagram creates an instance of the document and then adds it as a child of the unit testing browser in the scratchpad, via the getunittestcanvas method on app.xamlmanager. Note You could use the method marked as unittestafterclass, to delete this instance after each test on the class is run. An example of the XAMLButton behavior test is demonstrated in the following method.

126 Chapter 4 Considerations When Developing Silverlight Applications 126 The method in the previous example finds the button in the saved testdocument and then performs the following steps. 1. Checks that the button is in the normal (that is non-bold italicized) state. 2. Simulates clicking the button. 3. Checks that the button is in the bold italicized state. 4. Simulates clicking the button again. 5. Checks that the button has returned to the normal state. If the button behavior test, represented in the previous method, is run and passes, the following diagram shows an example of the passed test for a Silverlight stateless application. Note In the stateless version (shown in the previous diagram), the grid has been parented in the scratchpad area at the right of the browser. If you test the stateful version of the application, you might not see this, unless the document is not deleted after the test.

127 Chapter 4 Considerations When Developing Silverlight Applications 127 An example of the XamlCalendar behavior test is demonstrated in the following method. The method in the previous example finds the calendar in the saved testdocument and then performs the following steps. 1. Selects the current day on the calendar. 2. Restricts the calendar display to the current week. If the calendar behavior test, represented in the previous method, is run and passes, the following diagram shows an example of the passed test for a Silverlight stateless application.

Schema Inspector Utility User's Guide VERSION Copyright 2015 Jade Software Corporation Limited. All rights reserved.

Schema Inspector Utility User's Guide VERSION Copyright 2015 Jade Software Corporation Limited. All rights reserved. VERSION 7.0.12 Copyright 2015 Jade Software Corporation Limited. All rights reserved. Jade Software Corporation Limited cannot accept any financial or other responsibilities that may be the result of your

More information

Schema Inspector Utility User s Guide V E R S I O N Copyright 2016 Jade Software Corporation Limited. All rights reserved.

Schema Inspector Utility User s Guide V E R S I O N Copyright 2016 Jade Software Corporation Limited. All rights reserved. User s Guide V E R S I O N 2016.0.01 Copyright 2016 Jade Software Corporation Limited. All rights reserved. Jade Software Corporation Limited cannot accept any financial or other responsibilities that

More information

Dump and Load Utility User s Guide

Dump and Load Utility User s Guide Dump and Load Utility VERSION 6.3 Copyright 2009 Jade Software Corporation Limited All rights reserved Jade Software Corporation Limited cannot accept any financial or other responsibilities that may be

More information

Web Application Guide VERSION Copyright 2015 Jade Software Corporation Limited. All rights reserved.

Web Application Guide VERSION Copyright 2015 Jade Software Corporation Limited. All rights reserved. VERSION 7.0.12 Copyright 2015 Jade Software Corporation Limited. All rights reserved. Jade Software Corporation Limited cannot accept any financial or other responsibilities that may be the result of your

More information

Report Writer User s Guide V E R S I O N Copyright 2018 Jade Software Corporation Limited. All rights reserved.

Report Writer User s Guide V E R S I O N Copyright 2018 Jade Software Corporation Limited. All rights reserved. User s Guide V E R S I O N 2016.0.02 Copyright 2018 Jade Software Corporation Limited. All rights reserved. Jade Software Corporation Limited cannot accept any financial or other responsibilities that

More information

Thin Client Guide V E R S I O N Copyright 2018 Jade Software Corporation Limited. All rights reserved.

Thin Client Guide V E R S I O N Copyright 2018 Jade Software Corporation Limited. All rights reserved. V E R S I O N 2018.0.01 Copyright 2018 Jade Software Corporation Limited. All rights reserved. Jade Software Corporation Limited cannot accept any financial or other responsibilities that may be the result

More information

Monitor User's Guide VERSION Copyright 2014 Jade Software Corporation Limited. All rights reserved.

Monitor User's Guide VERSION Copyright 2014 Jade Software Corporation Limited. All rights reserved. VERSION 7.0.10 Copyright 2014 Jade Software Corporation Limited. All rights reserved. Jade Software Corporation Limited cannot accept any financial or other responsibilities that may be the result of your

More information

Thin Client Guide VERSION Copyright 2015 Jade Software Corporation Limited. All rights reserved.

Thin Client Guide VERSION Copyright 2015 Jade Software Corporation Limited. All rights reserved. VERSION 7.0.12 Copyright 2015 Jade Software Corporation Limited. All rights reserved. Jade Software Corporation Limited cannot accept any financial or other responsibilities that may be the result of your

More information

Installation and Configuration Guide VERSION Copyright 2015 Jade Software Corporation Limited. All rights reserved.

Installation and Configuration Guide VERSION Copyright 2015 Jade Software Corporation Limited. All rights reserved. VERSION 7.0.12 Copyright 2015 Jade Software Corporation Limited. All rights reserved. Jade Software Corporation Limited cannot accept any financial or other responsibilities that may be the result of your

More information

4D Write. User Reference Mac OS and Windows Versions. 4D Write D SA/4D, Inc. All Rights reserved.

4D Write. User Reference Mac OS and Windows Versions. 4D Write D SA/4D, Inc. All Rights reserved. 4D Write User Reference Mac OS and Windows Versions 4D Write 1999-2002 4D SA/4D, Inc. All Rights reserved. 4D Write User Reference Version 6.8 for Mac OS and Windows Copyright 1999 2002 4D SA/4D, Inc.

More information

Database Administration Guide VERSION Copyright 2014 Jade Software Corporation Limited. All rights reserved.

Database Administration Guide VERSION Copyright 2014 Jade Software Corporation Limited. All rights reserved. VERSION 7.0.10 Copyright 2014 Jade Software Corporation Limited. All rights reserved. Jade Software Corporation Limited cannot accept any financial or other responsibilities that may be the result of your

More information

Multithreading JADE Applications - A Primer White Paper VERSION 7.1. Copyright 2016 Jade Software Corporation Limited. All rights reserved.

Multithreading JADE Applications - A Primer White Paper VERSION 7.1. Copyright 2016 Jade Software Corporation Limited. All rights reserved. - A Primer VERSION 7.1 Copyright 2016 Jade Software Corporation Limited. All rights reserved. Jade Software Corporation Limited cannot accept any financial or other responsibilities that may be the result

More information

Code Coverage White Paper VERSION Copyright 2018 Jade Software Corporation Limited. All rights reserved.

Code Coverage White Paper VERSION Copyright 2018 Jade Software Corporation Limited. All rights reserved. VERSION 2016 Copyright 2018 Jade Software Corporation Limited. All rights reserved. Jade Software Corporation Limited cannot accept any financial or other responsibilities that may be the result of your

More information

Lava New Media s CMS. Documentation Page 1

Lava New Media s CMS. Documentation Page 1 Lava New Media s CMS Documentation 5.12.2010 Page 1 Table of Contents Logging On to the Content Management System 3 Introduction to the CMS 3 What is the page tree? 4 Editing Web Pages 5 How to use the

More information

DRAFT. Table of Contents About this manual... ix About CuteSITE Builder... ix. Getting Started... 1

DRAFT. Table of Contents About this manual... ix About CuteSITE Builder... ix. Getting Started... 1 DRAFT Table of Contents About this manual... ix About CuteSITE Builder... ix Getting Started... 1 Setting up... 1 System Requirements... 1 To install CuteSITE Builder... 1 To register CuteSITE Builder...

More information

Installation and Configuration Guide V E R S I O N Copyright 2016 Jade Software Corporation Limited. All rights reserved.

Installation and Configuration Guide V E R S I O N Copyright 2016 Jade Software Corporation Limited. All rights reserved. V E R S I O N 2016.0.01 Copyright 2016 Jade Software Corporation Limited. All rights reserved. Jade Software Corporation Limited cannot accept any financial or other responsibilities that may be the result

More information

Teamcenter 11.1 Systems Engineering and Requirements Management

Teamcenter 11.1 Systems Engineering and Requirements Management SIEMENS Teamcenter 11.1 Systems Engineering and Requirements Management Systems Architect/ Requirements Management Project Administrator's Manual REQ00002 U REQ00002 U Project Administrator's Manual 3

More information

JADE Installation and Administration Course VERSION Copyright 2018 Jade Software Corporation Limited. All rights reserved.

JADE Installation and Administration Course VERSION Copyright 2018 Jade Software Corporation Limited. All rights reserved. JADE Installation and Administration Course VERSION 2016 Copyright 2018 Jade Software Corporation Limited. All rights reserved. Jade Software Corporation Limited cannot accept any financial or other responsibilities

More information

Telerik Corp. Test Studio Standalone & Visual Studio Plug-In Quick-Start Guide

Telerik Corp. Test Studio Standalone & Visual Studio Plug-In Quick-Start Guide Test Studio Standalone & Visual Studio Plug-In Quick-Start Guide Contents Create your First Test... 3 Standalone Web Test... 3 Standalone WPF Test... 6 Standalone Silverlight Test... 8 Visual Studio Plug-In

More information

Code Coverage. Copyright 2009 JADE Software Corporation Limited. All rights reserved.

Code Coverage. Copyright 2009 JADE Software Corporation Limited. All rights reserved. Code Coverage JADE Software Corporation Limited cannot accept any financial or other responsibilities that may be the result of your use of this information or software material, including direct, indirect,

More information

OU EDUCATE TRAINING MANUAL

OU EDUCATE TRAINING MANUAL OU EDUCATE TRAINING MANUAL OmniUpdate Web Content Management System El Camino College Staff Development 310-660-3868 Course Topics: Section 1: OU Educate Overview and Login Section 2: The OmniUpdate Interface

More information

Contents. Project One. Introduction to Microsoft Windows XP and Office Creating and Editing a Word Document. Microsoft Word 2003

Contents. Project One. Introduction to Microsoft Windows XP and Office Creating and Editing a Word Document. Microsoft Word 2003 FM TBBBB 39909 10/27/06 4:06 PM Page iii Contents FMTOC TBBBB 39909 Page iii 10/20/06 MD Preface To the Student Introduction to Microsoft Windows XP and Office 2003 ix xiv Objectives WIN 4 Introduction

More information

Relational Queries Using ODBC

Relational Queries Using ODBC Relational Queries Using ODBC Jade Software Corporation Limited cannot accept any financial or other responsibilities that may be the result of your use of this information or software material, including

More information

The figure below shows the Dreamweaver Interface.

The figure below shows the Dreamweaver Interface. Dreamweaver Interface Dreamweaver Interface In this section you will learn about the interface of Dreamweaver. You will also learn about the various panels and properties of Dreamweaver. The Macromedia

More information

Creating Interactive PDF Forms

Creating Interactive PDF Forms Creating Interactive PDF Forms Using Adobe Acrobat X Pro for the Mac University Information Technology Services Training, Outreach, Learning Technologies and Video Production Copyright 2012 KSU Department

More information

NiceForm User Guide. English Edition. Rev Euro Plus d.o.o. & Niceware International LLC All rights reserved.

NiceForm User Guide. English Edition. Rev Euro Plus d.o.o. & Niceware International LLC All rights reserved. www.nicelabel.com, info@nicelabel.com English Edition Rev-0910 2009 Euro Plus d.o.o. & Niceware International LLC All rights reserved. www.nicelabel.com Head Office Euro Plus d.o.o. Ulica Lojzeta Hrovata

More information

WebVisit User course

WebVisit User course WebVisit 6.01.02 User course 1 Project creation and the user interface WebVisit User course 2 Getting started with visualization creation 3 Access to structures and fields 4 Macros in WebVisit Pro 5 Language

More information

Using the JADE Report Writer

Using the JADE Report Writer Using the JADE Report Writer Jade Software Corporation Limited cannot accept any financial or other responsibilities that may be the result of your use of this information or software material, including

More information

PBwiki Basics Website:

PBwiki Basics Website: Website: http://etc.usf.edu/te/ A wiki is a website that allows visitors to edit or add their own content to the pages on the site. The word wiki is Hawaiian for fast and this refers to how easy it is

More information

Schema Load Utility User's Guide VERSION Copyright 2015 Jade Software Corporation Limited. All rights reserved.

Schema Load Utility User's Guide VERSION Copyright 2015 Jade Software Corporation Limited. All rights reserved. VERSION 7.0.12 Copyright 2015 Jade Software Corporation Limited. All rights reserved. Jade Software Corporation Limited cannot accept any financial or other responsibilities that may be the result of your

More information

User Manual. pdoc Forms Designer. Version 3.7 Last Update: May 25, Copyright 2018 Topaz Systems Inc. All rights reserved.

User Manual. pdoc Forms Designer. Version 3.7 Last Update: May 25, Copyright 2018 Topaz Systems Inc. All rights reserved. User Manual pdoc Forms Designer Version 3.7 Last Update: May 25, 2018 Copyright 2018 Topaz Systems Inc. All rights reserved. For Topaz Systems, Inc. trademarks and patents, visit www.topazsystems.com/legal.

More information

Corel Ventura 8 Introduction

Corel Ventura 8 Introduction Corel Ventura 8 Introduction Training Manual A! ANZAI 1998 Anzai! Inc. Corel Ventura 8 Introduction Table of Contents Section 1, Introduction...1 What Is Corel Ventura?...2 Course Objectives...3 How to

More information

SPARK. User Manual Ver ITLAQ Technologies

SPARK. User Manual Ver ITLAQ Technologies SPARK Forms Builder for Office 365 User Manual Ver. 3.5.50.102 0 ITLAQ Technologies www.itlaq.com Table of Contents 1 The Form Designer Workspace... 3 1.1 Form Toolbox... 3 1.1.1 Hiding/ Unhiding/ Minimizing

More information

Layout and display. STILOG IST, all rights reserved

Layout and display. STILOG IST, all rights reserved 2 Table of Contents I. Main Window... 1 1. DEFINITION... 1 2. LIST OF WINDOW ELEMENTS... 1 Quick Access Bar... 1 Menu Bar... 1 Windows... 2 Status bar... 2 Pop-up menu... 4 II. Menu Bar... 5 1. DEFINITION...

More information

TinyMCE Users Guide. This user manual will show you all the basics of the TinyMCE editor.

TinyMCE Users Guide. This user manual will show you all the basics of the TinyMCE editor. Introduction TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor. What this means is that it will let you create html content on your web site. TinyMCE supports a lot of Operation

More information

Nauticom NetEditor: A How-to Guide

Nauticom NetEditor: A How-to Guide Nauticom NetEditor: A How-to Guide Table of Contents 1. Getting Started 2. The Editor Full Screen Preview Search Check Spelling Clipboard: Cut, Copy, and Paste Undo / Redo Foreground Color Background Color

More information

Runtime Application Guide VERSION Copyright 2014 Jade Software Corporation Limited. All rights reserved.

Runtime Application Guide VERSION Copyright 2014 Jade Software Corporation Limited. All rights reserved. VERSION 7.0.10 Copyright 2014 Jade Software Corporation Limited. All rights reserved. Jade Software Corporation Limited cannot accept any financial or other responsibilities that may be the result of your

More information

Funasset Limited Foundry House Foundry Road Taunton Somerset TA1 1JJ. Tel: +44 (0) Fax: +44 (0) mailmarkup.com funasset.

Funasset Limited Foundry House Foundry Road Taunton Somerset TA1 1JJ. Tel: +44 (0) Fax: +44 (0) mailmarkup.com funasset. Funasset Limited Foundry House Foundry Road Taunton Somerset TA1 1JJ Tel: +44 (0)1823 365864 Fax: +44 (0)1823 277266 mailmarkup.com funasset.com Copyright 2012 Funasset Limited. All rights reserved. Products

More information

Microsoft Windows SharePoint Services

Microsoft Windows SharePoint Services Microsoft Windows SharePoint Services SITE ADMIN USER TRAINING 1 Introduction What is Microsoft Windows SharePoint Services? Windows SharePoint Services (referred to generically as SharePoint) is a tool

More information

Creating Buttons and Pop-up Menus

Creating Buttons and Pop-up Menus Using Fireworks CHAPTER 12 Creating Buttons and Pop-up Menus 12 In Macromedia Fireworks 8 you can create a variety of JavaScript buttons and CSS or JavaScript pop-up menus, even if you know nothing about

More information

MPLAB Harmony Help - MPLAB Harmony Graphics Composer User's Guide

MPLAB Harmony Help - MPLAB Harmony Graphics Composer User's Guide MPLAB Harmony Help - MPLAB Harmony Graphics Composer User's Guide MPLAB Harmony Integrated Software Framework v1.11 2013-2017 Microchip Technology Inc. All rights reserved. MPLAB Harmony Graphics Composer

More information

Using Adobe Contribute 4 A guide for new website authors

Using Adobe Contribute 4 A guide for new website authors Using Adobe Contribute 4 A guide for new website authors Adobe Contribute allows you to easily update websites without any knowledge of HTML. This handout will provide an introduction to Adobe Contribute

More information

How to set up a local root folder and site structure

How to set up a local root folder and site structure Activity 2.1 guide How to set up a local root folder and site structure The first thing to do when creating a new website with Adobe Dreamweaver CS3 is to define a site and identify a root folder where

More information

User Guide. FTR Reporter For more information, visit

User Guide. FTR Reporter For more information, visit FTR Reporter 5.7.1 For more information, visit www.fortherecord.com TABLE OF CONTENTS INTRODUCTION... 5 Overview... 5 About This Document... 5 GETTING STARTED... 6 Installation... 6 Starting Reporter...

More information

Using Sitecore 5.3.1

Using Sitecore 5.3.1 Using Sitecore 5.3.1 An End-User s Guide to Using and Administrating Sitecore Author: Sitecore Corporation Date: December 12, 2007 Release: Rev. 1.0 Language: English Sitecore is a registered trademark.

More information

Lesson 2 Quick Tour and Features

Lesson 2 Quick Tour and Features Lesson 2 Quick Tour and Features Objectives Students will format a document page. Students will use a spell-checker. Students will copy, cut, and paste text. Students will adjust paragraph indentations.

More information

End User s Guide Release 5.0

End User s Guide Release 5.0 [1]Oracle Application Express End User s Guide Release 5.0 E39146-04 August 2015 Oracle Application Express End User's Guide, Release 5.0 E39146-04 Copyright 2012, 2015, Oracle and/or its affiliates. All

More information

JIRA Editor Documentation Pasting from Word, Excel or Outlook

JIRA Editor Documentation Pasting from Word, Excel or Outlook JIRA Editor Documentation Pasting from Word, Excel or Outlook Date: [13 May 2015] Version: 1.0 Table of contents 1 Why JEditor in Jira 4 1.1 How does it work? 4 1.1.1 With ticket creation 5 1.1.2 With

More information

Forms iq Designer Training

Forms iq Designer Training Forms iq Designer Training Copyright 2008 Feith Systems and Software, Inc. All Rights Reserved. No part of this publication may be reproduced, transmitted, stored in a retrieval system, or translated into

More information

Microsoft Office Word. Help. Opening a Document. Converting from Older Versions

Microsoft Office Word. Help. Opening a Document. Converting from Older Versions Microsoft Office 2007 - Word Help Click on the Microsoft Office Word Help button in the top right corner. Type the desired word in the search box and then press the Enter key. Choose the desired topic

More information

Introduction to IBM Rational HATS For IBM System i (5250)

Introduction to IBM Rational HATS For IBM System i (5250) Introduction to IBM Rational HATS For IBM System i (5250) Introduction to IBM Rational HATS 1 Lab instructions This lab teaches you how to use IBM Rational HATS to create a Web application capable of transforming

More information

Oracle Communications Network Charging and Control. Subscriber Profile Manager User's Guide Release: NCC4.4.1

Oracle Communications Network Charging and Control. Subscriber Profile Manager User's Guide Release: NCC4.4.1 Oracle Communications Network Charging and Control Subscriber Profile Manager Release: NCC4.4.1 December 2011 Commercial In Confidence Copyright Copyright 2011, Oracle and/or its affiliates. All rights

More information

Chapter 4: Single Table Form Lab

Chapter 4: Single Table Form Lab Chapter 4: Single Table Form Lab Learning Objectives This chapter provides practice with creating forms for individual tables in Access 2003. After this chapter, you should have acquired the knowledge

More information

GoLive will first ask you if your new site will be for one individual or a work group; select for a Single User, and click Next.

GoLive will first ask you if your new site will be for one individual or a work group; select for a Single User, and click Next. Getting Started From the Start menu, located the Adobe folder which should contain the Adobe GoLive 6.0 folder. Inside this folder, click Adobe GoLive 6.0. GoLive will open to its initial project selection

More information

Libraries. Multi-Touch. Aero Peek. Sema Foundation 10 Classes 2 nd Exam Review ICT Department 5/22/ Lesson - 15

Libraries. Multi-Touch. Aero Peek. Sema Foundation 10 Classes 2 nd Exam Review ICT Department 5/22/ Lesson - 15 10 Classes 2 nd Exam Review Lesson - 15 Introduction Windows 7, previous version of the latest version (Windows 8.1) of Microsoft Windows, was produced for use on personal computers, including home and

More information

Quark XML Author for FileNet 2.5 with BusDocs Guide

Quark XML Author for FileNet 2.5 with BusDocs Guide Quark XML Author for FileNet 2.5 with BusDocs Guide CONTENTS Contents Getting started...6 About Quark XML Author...6 System setup and preferences...8 Logging in to the repository...8 Specifying the location

More information

Table of Contents. Word. Using the mouse wheel 39 Moving the insertion point using the keyboard 40 Resume reading 41

Table of Contents. Word. Using the mouse wheel 39 Moving the insertion point using the keyboard 40 Resume reading 41 Table of Contents iii Table of Contents Word Starting Word What is word processing? 2 Starting Word 2 Exploring the Start screen 4 Creating a blank document 4 Exploring the Word document window 5 Exploring

More information

Unit 8. Lesson 8.1. Microsoft FrontPage. Introduction. Microsoft FrontPage-1. Microsoft FrontPage

Unit 8. Lesson 8.1. Microsoft FrontPage. Introduction. Microsoft FrontPage-1. Microsoft FrontPage Microsoft FrontPage Unit 8 Microsoft FrontPage Introduction Lesson 8.1 Microsoft FrontPage-1 A number of Software Packages are available in market for creating a website. Among popular software s are Dreamweaver,

More information

Table of Contents. MySource Matrix Content Types Manual

Table of Contents. MySource Matrix Content Types Manual Table of Contents Chapter 1 Introduction... 5 Chapter 2 WYSIWYG Editor... 6 Replace Text... 6 Select Snippet Keyword... 7 Insert Table and Table Properties... 8 Editing the Table...10 Editing a Cell...12

More information

Computer Nashua Public Library Introduction to Microsoft Word 2010

Computer Nashua Public Library Introduction to Microsoft Word 2010 Microsoft Word is a word processing program you can use to write letters, resumes, reports, and more. Anything you can create with a typewriter, you can create with Word. You can make your documents more

More information

Dreamweaver Basics. Planning your website Organize site structure Plan site design & navigation Gather your assets

Dreamweaver Basics. Planning your website Organize site structure Plan site design & navigation Gather your assets Dreamweaver Basics Planning your website Organize site structure Plan site design & navigation Gather your assets Creating your website Dreamweaver workspace Define a site Create a web page Linking Manually

More information

PRESENCE. RadEditor Guide. SchoolMessenger 100 Enterprise Way, Suite A-300 Scotts Valley, CA

PRESENCE. RadEditor Guide. SchoolMessenger 100 Enterprise Way, Suite A-300 Scotts Valley, CA PRESENCE RadEditor Guide SchoolMessenger 100 Enterprise Way, Suite A-300 Scotts Valley, CA 95066 800-920-3897 www.schoolmessenger.com Contents Contents... 2 Introduction... 3 What is RadEditor?... 3 RadEditor

More information

Erewhon Demonstration System Reference VERSION Copyright 2018 Jade Software Corporation Limited. All rights reserved.

Erewhon Demonstration System Reference VERSION Copyright 2018 Jade Software Corporation Limited. All rights reserved. VERSION 2018 Copyright 2018 Jade Software Corporation Limited. All rights reserved. Jade Software Corporation Limited cannot accept any financial or other responsibilities that may be the result of your

More information

Dreamweaver MX Overview. Maintaining a Web Site

Dreamweaver MX Overview. Maintaining a Web Site Dreamweaver MX Overview Maintaining a Web Site... 1 The Process... 1 Filenames... 1 Starting Dreamweaver... 2 Uploading and Downloading Files... 6 Check In and Check Out Files... 6 Editing Pages in Dreamweaver...

More information

Quark XML Author for FileNet 2.8 with BusDocs Guide

Quark XML Author for FileNet 2.8 with BusDocs Guide Quark XML Author for FileNet.8 with BusDocs Guide Contents Getting started... About Quark XML Author... System setup and preferences... Logging on to the repository... Specifying the location of checked-out

More information

WINDOWS NT BASICS

WINDOWS NT BASICS WINDOWS NT BASICS 9.30.99 Windows NT Basics ABOUT UNIVERSITY TECHNOLOGY TRAINING CENTER The University Technology Training Center (UTTC) provides computer training services with a focus on helping University

More information

Word Getting Started The Word Window u vw. Microsoft QUICK Source. Creating a New Blank Document. Creating a New Document from a Template

Word Getting Started The Word Window u vw. Microsoft QUICK Source. Creating a New Blank Document. Creating a New Document from a Template Microsoft QUICK Source Word 2007 Getting Started The Word Window u vw x y z u Quick Access Toolbar contains shortcuts for the most commonly used tools. v Microsoft Office Button contains common file and

More information

Website Design Guide

Website Design Guide Website Design Guide 8/28/2017 Spark Website Design US 2017 Blackbaud, Inc. This publication, or any part thereof, may not be reproduced or transmitted in any form or by any means, electronic, or mechanical,

More information

USER GUIDE MADCAP FLARE Tables

USER GUIDE MADCAP FLARE Tables USER GUIDE MADCAP FLARE 2018 Tables Copyright 2018 MadCap Software. All rights reserved. Information in this document is subject to change without notice. The software described in this document is furnished

More information

PowerPoint 2010 Level 1 Computer Training Solutions Student Guide Version Revision Date Course Length

PowerPoint 2010 Level 1 Computer Training Solutions Student Guide Version Revision Date Course Length Level 1 Computer Training Solutions Version 1.2 Revision Date Course Length 2012-Feb-16 6 hours Table of Contents Quick Reference... 3 Frequently Used Commands... 3 Manitoba ehealth Learning Management

More information

Introduction to Microsoft Word 2010

Introduction to Microsoft Word 2010 Introduction to Microsoft Word 2010 Microsoft Word is a word processing program you can use to write letters, resumes, reports, and more. Anything you can create with a typewriter, you can create with

More information

Computer Shortcuts. Files menu options in current program. Edits options in current program Universal Help in almost every Windows program.

Computer Shortcuts. Files menu options in current program. Edits options in current program Universal Help in almost every Windows program. www.bankjobszone.com Computer Shortcuts Shortcut keys Concept: Shortcuts keys help provide an easier and usually quicker method of navigating and using computer software programs. Shortcut keys are commonly

More information

COGNOS (R) 8 COGNOS CONNECTION USER GUIDE USER GUIDE THE NEXT LEVEL OF PERFORMANCE TM. Cognos Connection User Guide

COGNOS (R) 8 COGNOS CONNECTION USER GUIDE USER GUIDE THE NEXT LEVEL OF PERFORMANCE TM. Cognos Connection User Guide COGNOS (R) 8 COGNOS CONNECTION USER GUIDE Cognos Connection User Guide USER GUIDE THE NEXT LEVEL OF PERFORMANCE TM Product Information This document applies to Cognos (R) 8 Version 8.1.2 MR2 and may also

More information

Overview of the Adobe Dreamweaver CS5 workspace

Overview of the Adobe Dreamweaver CS5 workspace Adobe Dreamweaver CS5 Activity 2.1 guide Overview of the Adobe Dreamweaver CS5 workspace You can access Adobe Dreamweaver CS5 tools, commands, and features by using menus or by selecting options from one

More information

OpenForms360 Validation User Guide Notable Solutions Inc.

OpenForms360 Validation User Guide Notable Solutions Inc. OpenForms360 Validation User Guide 2011 Notable Solutions Inc. 1 T A B L E O F C O N T EN T S Introduction...5 What is OpenForms360 Validation?... 5 Using OpenForms360 Validation... 5 Features at a glance...

More information

Excel Select a template category in the Office.com Templates section. 5. Click the Download button.

Excel Select a template category in the Office.com Templates section. 5. Click the Download button. Microsoft QUICK Excel 2010 Source Getting Started The Excel Window u v w z Creating a New Blank Workbook 2. Select New in the left pane. 3. Select the Blank workbook template in the Available Templates

More information

Independence Community College Independence, Kansas

Independence Community College Independence, Kansas Independence Community College Independence, Kansas C O N T E N T S Unit 1: Creating, Modifying, and Enhancing FrontPage Webs and Pages 1 Chapter 1 Investigating FrontPage 2002 3 Exploring World Wide Web

More information

Nintex Forms 2010 Help

Nintex Forms 2010 Help Nintex Forms 2010 Help Last updated: Monday, April 20, 2015 1 Administration and Configuration 1.1 Licensing settings 1.2 Activating Nintex Forms 1.3 Web Application activation settings 1.4 Manage device

More information

User Guide. Chapter 6. Teacher Pages

User Guide. Chapter 6. Teacher Pages User Guide Chapter 6 s Table of Contents Introduction... 5 Tips for s... 6 Pitfalls... 7 Key Information... 8 I. How to add a... 8 II. How to Edit... 10 SharpSchool s WYSIWYG Editor... 11 Publish a...

More information

Instructor User Guide Table Of Contents

Instructor User Guide Table Of Contents Instructor User Guide Table Of Contents Getting Started...1 Using myitlab...1 Getting Started in myitlab...1 Contacting myitlab Instructor Support...1 myitlab System Requirements...1 Logging in to myitlab...1

More information

Creating a Website with Publisher 2016

Creating a Website with Publisher 2016 Creating a Website with Publisher 2016 Getting Started University Information Technology Services Learning Technologies, Training & Audiovisual Outreach Copyright 2017 KSU Division of University Information

More information

Introduction to Microsoft Word 2010

Introduction to Microsoft Word 2010 Introduction to Microsoft Word 2010 Microsoft Word is a word processing program you can use to write letters, resumes, reports, and more. Anything you can create with a typewriter, you can create with

More information

USER GUIDE. MADCAP FLARE 2017 r3. QR Codes

USER GUIDE. MADCAP FLARE 2017 r3. QR Codes USER GUIDE MADCAP FLARE 2017 r3 QR Codes Copyright 2018 MadCap Software. All rights reserved. Information in this document is subject to change without notice. The software described in this document is

More information

TABLE OF CONTENTS TABLE OF CONTENTS... 1 INTRODUCTION... 2 USING WORD S MENUS... 3 USING WORD S TOOLBARS... 5 TASK PANE... 9

TABLE OF CONTENTS TABLE OF CONTENTS... 1 INTRODUCTION... 2 USING WORD S MENUS... 3 USING WORD S TOOLBARS... 5 TASK PANE... 9 TABLE OF CONTENTS TABLE OF CONTENTS... 1 INTRODUCTION... 2 USING WORD S MENUS... 3 DEFINITIONS... 3 WHY WOULD YOU USE THIS?... 3 STEP BY STEP... 3 USING WORD S TOOLBARS... 5 DEFINITIONS... 5 WHY WOULD

More information

Netscape Composer Tutorial

Netscape Composer Tutorial Netscape Composer Tutorial This tutorial will show you how to use Netscape Composer to create web pages. Netscape Composer integrates powerful What-You-See-Is-What-You-Get (WYSIWYG) document creation capabilities

More information

ECDL Module 6 REFERENCE MANUAL

ECDL Module 6 REFERENCE MANUAL ECDL Module 6 REFERENCE MANUAL Presentation Microsoft PowerPoint XP Edition for ECDL Syllabus Four PAGE 2 - ECDL MODULE 6 (USING POWERPOINT XP) - MANUAL 6.1 GETTING STARTED... 4 6.1.1 FIRST STEPS WITH

More information

Introduction to IBM Rational HATS For IBM System z (3270)

Introduction to IBM Rational HATS For IBM System z (3270) Introduction to IBM Rational HATS For IBM System z (3270) Introduction to IBM Rational HATS 1 Lab instructions This lab teaches you how to use IBM Rational HATS to create a Web application capable of transforming

More information

Microsoft Word 2010 Basics

Microsoft Word 2010 Basics 1 Starting Word 2010 with XP Click the Start Button, All Programs, Microsoft Office, Microsoft Word 2010 Starting Word 2010 with 07 Click the Microsoft Office Button with the Windows flag logo Start Button,

More information

Océ Posterizer Pro Designer. POP into retail. User manual Application guide

Océ Posterizer Pro Designer. POP into retail. User manual Application guide - Océ Posterizer Pro Designer POP into retail o User manual Application guide Copyright copyright-2010 Océ All rights reserved. No part of this work may be reproduced, copied, adapted, or transmitted in

More information

Kendo UI. Builder by Progress : What's New

Kendo UI. Builder by Progress : What's New Kendo UI Builder by Progress : What's New Copyright 2017 Telerik AD. All rights reserved. July 2017 Last updated with new content: Version 2.0 Updated: 2017/07/13 3 Copyright 4 Contents Table of Contents

More information

HYPERION SYSTEM 9 BI+ GETTING STARTED GUIDE APPLICATION BUILDER J2EE RELEASE 9.2

HYPERION SYSTEM 9 BI+ GETTING STARTED GUIDE APPLICATION BUILDER J2EE RELEASE 9.2 HYPERION SYSTEM 9 BI+ APPLICATION BUILDER J2EE RELEASE 9.2 GETTING STARTED GUIDE Copyright 1998-2006 Hyperion Solutions Corporation. All rights reserved. Hyperion, the Hyperion H logo, and Hyperion s product

More information

Quark XML Author October 2017 Update for Platform with Business Documents

Quark XML Author October 2017 Update for Platform with Business Documents Quark XML Author 05 - October 07 Update for Platform with Business Documents Contents Getting started... About Quark XML Author... Working with the Platform repository...3 Creating a new document from

More information

How to lay out a web page with CSS

How to lay out a web page with CSS Activity 2.6 guide How to lay out a web page with CSS You can use table design features in Adobe Dreamweaver CS4 to create a simple page layout. However, a more powerful technique is to use Cascading Style

More information

Oracle Eloqua s User Guide

Oracle Eloqua  s User Guide http://docs.oracle.com Oracle Eloqua Emails User Guide 2018 Oracle Corporation. All rights reserved 11-Jan-2018 Contents 1 Emails Overview 6 2 Examples of emails 7 3 Creating emails 19 4 Email authoring

More information

Microsoft Word Important Notice

Microsoft Word Important Notice Microsoft Word 2013 Important Notice All candidates who follow an ICDL/ECDL course must have an official ICDL/ECDL Registration Number (which is proof of your Profile Number with ICDL/ECDL and will track

More information

SAP Crystal Reports for Enterprise User Guide SAP Crystal Reports for Enterprise

SAP Crystal Reports for Enterprise User Guide SAP Crystal Reports for Enterprise SAP Crystal Reports for Enterprise User Guide SAP Crystal Reports for Enterprise Copyright 2011 SAP AG. All rights reserved.sap, R/3, SAP NetWeaver, Duet, PartnerEdge, ByDesign, SAP BusinessObjects Explorer,

More information

Word 2010 Beginning. Technology Integration Center

Word 2010 Beginning. Technology Integration Center Word 2010 Beginning File Tab... 2 Quick Access Toolbar... 2 The Ribbon... 3 Help... 3 Opening a Document... 3 Documents from Older Versions... 4 Document Views... 4 Navigating the Document... 5 Moving

More information

Oracle FLEXCUBE UI Style Designer Oracle FLEXCUBE Universal Banking Release 12.0 [May] [2012] Oracle Part Number E

Oracle FLEXCUBE UI Style Designer Oracle FLEXCUBE Universal Banking Release 12.0 [May] [2012] Oracle Part Number E Oracle FLEXCUBE UI Style Designer Oracle FLEXCUBE Universal Banking Release 12.0 [May] [2012] Oracle Part Number E51527-01 Table of Contents Oracle FLEXCUBE UI Style Designer 1. ABOUT THIS MANUAL... 1-1

More information

Asynchronous Method Calls White Paper VERSION Copyright 2014 Jade Software Corporation Limited. All rights reserved.

Asynchronous Method Calls White Paper VERSION Copyright 2014 Jade Software Corporation Limited. All rights reserved. VERSION 7.0.10 Copyright 2014 Jade Software Corporation Limited. All rights reserved. Jade Software Corporation Limited cannot accept any financial or other responsibilities that may be the result of your

More information

Publisher 2016 Foundation. North American Edition SAMPLE

Publisher 2016 Foundation. North American Edition SAMPLE Publisher 2016 Foundation Publisher 2016 Foundation North American Edition Microsoft Publisher 2016 Foundation - Page 2 2015 Cheltenham Group Pty. Ltd. All trademarks acknowledged. E&OE. No part of this

More information