Wow Your End Users

[Pages:36]Wow Your End Users

Visual Studio LightSwitch Technical White Paper

Author: Andrew Brust, Blue Badge Insights

Published: August, 2011 Applies to: Visual Studio LightSwitch 2011

Summary: This is the fourth in a series of white papers about Microsoft? Visual Studio? LightSwitchTM 2011, Microsoft's new streamlined development environment for designing data-centric business applications. We'll explore the finer points of LightSwitch user interface design, including menus and navigation, screen templates, search, export, and application deployment.

Copyright

The information contained in this document represents the current view of Microsoft Corporation on the issues discussed as of the date of publication. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information presented after the date of publication. This white paper is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED, OR STATUTORY, AS TO THE INFORMATION IN THIS DOCUMENT. Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under copyright, no part of this document may be reproduced, stored in, or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, without the express written permission of Microsoft Corporation. Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this document. Except as expressly provided in any written license agreement from Microsoft, the furnishing of this document does not give you any license to these patents, trademarks, copyrights, or other intellectual property. Unless otherwise noted, the example companies, organizations, products, domain names, email addresses, logos, people, places, and events depicted herein are fictitious, and no association with any real company, organization, product, domain name, e-mail address, logo, person, place, or event is intended or should be inferred.

? 2011 Microsoft Corporation. All rights reserved.

Microsoft, Microsoft? LightSwitch? 2011, Microsoft? Excel, Microsoft? SQL Server?, Visual FoxPro?, Visual Basic?, Microsoft? Windows? AzureTM, are trademarks of the Microsoft group of companies.

All other trademarks are property of their respective owners.

2

White Papers in this Series

1. What is LightSwitch? 2. Quickly Build Business Apps 3. Get More from Your Data 4. Wow Your End Users 5. Make Your Apps Do More with Less Work

3

Contents

Introduction .................................................................................................................................................. 6 Menu and Navigation.................................................................................................................................... 6 Screen Templates.......................................................................................................................................... 8

The New Data Screen Template................................................................................................................ 9 Some Property Settings ...................................................................................................................... 10

The Search Data Template ...................................................................................................................... 13 Making Queries and Fields Searchable ....................................................................................................... 14 Export to Excel ............................................................................................................................................ 15 Designing Screens ....................................................................................................................................... 15

Working with Generated Screens ........................................................................................................... 16 Building Your Own Screens ..................................................................................................................... 17

Designing Screens from the Members List ......................................................................................... 18 Using the "Add" Node......................................................................................................................... 18 Adding Unbound Groups .................................................................................................................... 20 Modifying Layout and Control Types .................................................................................................. 22 Layout Types ....................................................................................................................................... 24 Composite Controls............................................................................................................................. 25 Deployment ................................................................................................................................................ 26 Client Application Type ........................................................................................................................... 27 Application Server................................................................................................................................... 27 On-Premise or Cloud........................................................................................................................... 27 Configuring Your Deployment ................................................................................................................ 27 Further Requirements............................................................................................................................. 28 Set Configuration to Release............................................................................................................... 28 Security Certificates ............................................................................................................................ 29 Server Prerequisites ............................................................................................................................ 29 Azure-Specific Requirements .............................................................................................................. 29 Conclusion................................................................................................................................................... 30 LightSwitch Screen Design Nitty-Gritty....................................................................................................... 31 Element Types......................................................................................................................................... 31

4

Command Bars........................................................................................................................................ 32 Common Properties .................................................................................................................................... 32

Sizing and Appearance Properties .......................................................................................................... 32 Row and Column Properties ................................................................................................................... 34 Group Properties..................................................................................................................................... 35

5

Introduction

This is the fourth in a series of white papers about Microsoft? Visual Studio? LightSwitchTM 2011, Microsoft's new streamlined development environment for designing data-centric business applications. We'll explore the finer points of LightSwitch user interface design, including menus and navigation, screen templates, search, export, application deployment.

In the first paper, we provided an overview of the product and an analysis of the market need it meets. In paper #2, we provided and discussed the steps involved in the development of a sample LightSwitch application. In paper #3, we discussed LightSwitch's data capabilities more deeply. In this paper, we'll explore the finer points of LightSwitch user interface design, including:

menus and navigation screen templates search export to Microsoft? Excel? screen design, layout concepts and the visual tree application deployment (including cloud deployment to Windows? AzureTM and SQL Azure)

We'll discuss each of these features in turn, as understanding how to work with them will truly roundout your LightSwitch knowledge. Not only will you understand how to be productive in LightSwitch quickly but you'll have real expertise in working with data and screens. The means you'll be ready to build applications that cater to most mainstream business application requirements and you will be ready to put those applications in users' hands. You will also be ready to take full advantage of the review of LightSwitch extensions in the next (and last) paper in this series.

While screens provide the bricks of an application, the menu and navigation techniques are the mortar. So let's start with a deeper look at menu design and capabilities than we've had thus far, and then move on to screens and deployment.

Menu and Navigation

Screens aren't all that make a user-friendly application. Menus and navigation are important as well. To get ready to discuss this topic in full, let's review what we've learned so far about LightSwitch application menus. This is what we've seen, but haven't called out explicitly:

1. Links are added to the menu under the Tasks group header as screens are created, and are ordered based on when they were added to the project. The text of each link is based on the name of the screen.

2. The first screen added to the menu becomes the application's startup screen (displayed automatically when the application starts).

3. No links are created for parameterized detail screens, which must be called from code or from summary field data displayed as links.

6

4. A special Administration group is added to the menu if authentication is enabled, and is visible to users granted the SecurityAdministration permission.

All of our examples so far have resulted in menus being generated, but we've been going about menu design a bit passively. We can exert much more control over the composition and behavior of our menus, with very little incremental effort. Command central for crafting menus more explicitly is the Screen Navigation tab of the project properties. Here are some other things we can do there:

1. Rename (change the text of), reorder, or delete any link or group. 2. Add links and groups manually. 3. Control access to any link through its CanRun event handler1. 4. Set any link to be the application's startup screen. If you double-click the Properties link in Solution Explorer (or select the Project/projectname Properties... menu option) and then click the Screen Navigation tab, the Screen Navigation property sheet displays as shown in Figure 1.

Figure 1 - The Screen Navigation property sheet

1 Any link for which a user is denied access is not visible on the menu for that user. If the user is denied access to all links in a group, then the group header is not visible either.

7

Notice the following highlighted, numbered elements:

1. Screen Navigation tab 2. reorder buttons 3. links' context menu 4. Include Screen option 5. Add Group option 6. startup screen controls

As you can see, screen navigation in LightSwitch is quite flexible. However, the menu is not the sole means of navigation. You can also add a custom button to a screen and configure it to load any other screen in the application. You just need a single line of code in the button's Execute event handler to make this work.

For each screen in the application, LightSwitch creates a method on the Application object to load the screen. The name of the method is formed from the word "Show" and the name of the screen. If the screen is parameterized, then the method is as well, and you can pass a specific value to load the appropriate data. For example, if we add a button to our EditableExpensesGrid screen to view BudgetCategory detail data corresponding to the selected Expense record. That code is shown in Listing 1.

Listing 1 - Loading a parameterized screen programmatically

partial void ViewCatgeory_Execute() {

Application.ShowBudgetCategoryDetail(Expenses.SelectedItem.BudgetCategory.Id); }

Another navigation technique is to render data in List and Data Grid controls as links using a Summary control. When a user clicks these links, detail data screens are displayed automatically. Data for relationship fields can be rendered as links using the Summary control's Show as Link option in the Properties window. Checking the Show at Link property enables the Target Screen drop-down list property. The latter is automatically set to Default, but the drop-down list contains all related detail screens. When the Default setting is used, LightSwitch generates an edit screen for your data on-the-fly, unless a user screen is designated as the default details screen for that entity. In the latter case, the default screen for the entity is shown instead.

Screen Templates

We've now discussed how to move between screens, so it's time to focus on screen design, specifically on the different built-in types of screens LightSwitch offers. So far, we've looked at three of LightSwitch's built-in screen templates:

Editable Grid

8

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download