Contents

About the Author

About the Technical Reviewers

Acknowledgments

Foreword

Introduction

images Chapter 1: Introducing LightSwitch

Understanding LightSwitch’s Architecture

The Data Layer

The Logic Layer

The Presentation Layer

Introducing the Model-Centric Architecture

Building Your Application

Understanding the Model-View-ViewModel Pattern

Examining LightSwitch Projects

Reducing Project Sizes

Summary

images Chapter 2: Setting Up Your Data

Choosing Where to Store Your Data

What Are Entities and Properties?

Creating Tables (Entities)

Creating Fields (Properties)

Storing String Data

Storing Numbers (Double and Decimal Types)

Formatting Numeric Fields

Storing Images

Storing Binary Data

Ensuring Unique Values

Changing Data Types

Using LightSwitch Business Types

Storing Email Addresses

Storing Money Values

Storing Phone Numbers

Storing Web Addresses and Percentage Values

Examining What Happens in SQL Server

Creating Choice Lists

Choice Lists vs. Related Tables

Defining Relationships

Defining One-to-Many Type Relationships

How Relationships Are Defined in SQL Server

Defining Self-Referencing Relationships

Defining Many-to-Many Relationships

Determining How Child Records Are Deleted

Attaching Existing Data

Attaching to an Existing Database

Attaching to SharePoint Data

Deleting a Data Source

Creating Computed Properties

Creating Summary Properties

Calculating Dates with Computed Properties

Summarizing Child Records with Computed Properties

Returning Images with Computed Properties

Sorting and Filtering by Computed Properties

Summary

images Chapter 3: Introducing Silverlight Screen Design

Choosing a Screen Template

Showing a Single Record

Organizing Your Screen

Introducing the Screen Designer Toolbar

Setting Screen Properties

Grouping and Laying Out Your Screen

Displaying Static Text and Images

Choosing Data Controls

Displaying Data Using Data Item Containers

Including Related Data Items

Showing Collections of Records

Configuring Data Grid Settings

Setting Data Grid Header Buttons

Using Data-Selection Controls

Using the Auto Complete Box Control

Using the Modal Window Picker Control

Setting Control Appearances

Positioning Control Labels

Styling Labels and Static Text Controls

Making Controls Read-Only

Creating a Search Screen

Launching Child Screens

Setting Application Properties

Changing the Language and Culture Settings

Configuring Screen Navigation

Designing Screens at Run Time

Summary

images Chapter 4: Accessing Data with Code

Performing Application Tasks in Code

Working with Data

Creating Records

Finding Single Records by ID Value

Updating Records

Deleting Records

Working with Properties and Nullable Data Types

Working with User Details

Working with Screen Data

Working with Screen Events

Working with the Save Pipeline

Calling Server-Side Code from the Client

Working with Change Sets

Retrieving Original Values

Discarding Items That Have Changed

Managing Transactions in LightSwitch

Applying Transactions on Screens

Creating Transactions in the Save Pipeline

Understanding Concurrency

Displaying a Data-Conflict Screen

Handling Conflicts in Code

Summary

images Chapter 5: Validating Data

Understanding Validation in LightSwitch

How Client Validation Works

How MVVM Applies to Validation

Defining Validation Rules

Writing Custom Validation

Identifying Where Validation Runs

Creating Validation Rules and Warnings

Custom Validation Examples

Comparing Against Other Properties

Mandating Data Using Conditions

Validating Patterns with Regular Expressions

Validating File Sizes

Checking Against Child Collections

Enforcing Uniqueness and Preventing Duplicates

Performing Screen Validation

Validating Deletions

Validating Deletions on the Server

Accessing Validation Results in Code

Database Validation

Summary

images Chapter 6: Querying Your Data

Introduction to Data Retrieval

LightSwitch Queries Always Return Entities

Understanding the Query Pipeline

Using LightSwitch’s Default Queries

Filtering and Sorting Data

Creating Queries Based on Entities

Applying Filters

Comparing Against Other Fields/Properties

Passing Arguments into a Query

Filtering by Global Values

Sorting Data

Sorting Data Grids

Examining User Setting Files

Modifying Screen Queries

Writing Queries in Code

Understanding LINQ Syntax

Understanding Method (Lambda) Syntax Code

Using Standard Query Operators

Filtering Data with Lambda Expressions

Using the Any and All Operators

Performing For Each Logic

Querying Data Remotely

Querying Data Locally

Performing Advanced Filtering

Filtering by Related Child Items

Exists, In

Not Exists, Not In

Filtering by Date Elements

Top N Records

Creating Global Values

Adding Your Global Value to Your LSML File

Creating the Global Value Class

Using Global Values in Upgraded Projects

Summary

images Chapter 7: Mastering Silverlight Screen Design

Working with Screen Data

Displaying Custom Text and Information

Adding Data Controls to a Screen

Setting Control Values and Default Values

Setting the Screen Title in Code

Creating an Advanced Search Screen

Managing Screens

Opening Screens from Buttons or Links

Refreshing All Open Screens

Passing Arguments into Screens

Creating a Continuous New Data Screen

Working with Controls

Finding Controls Using FindControl

Reference the Underlying Silverlight Control

Handling Silverlight Control Events

Custom Examples

Designing an Add/Edit Screen

Customizing Data Grid Dialogs

Nesting Autocomplete Boxes

Bulk Updating Records by Using a Multiselect Grid

Assigning and Unassigning Self-Joined Data

Creating Screens to Work with Single Row Tables

Working with Threads

Finding Out Which Thread Your Code Is Executing On

Understanding When to Execute Code on a Different Thread

Reacting to Data Changes

Using PropertyChanged on a New Data Screen Template

Using PropertyChanged on a Details Screen

Working with Files

Uploading Files

Downloading and Saving Files

Opening Files in Their Application

Summary

images Chapter 8: Creating HTML Interfaces

Introducing the HTML Client

Setting Up Visual Studio for HTML Development

Adding an HTML Client

Adding Screens to Your Application

Designing Screens

Understanding the Top-Level Screen Layout

Using Data List Controls

Using Data Controls

Using Data-Picker Controls

Setting Screen Properties

Creating a Navigation Structure

Creating a Startup Screen

Navigating to Different Screens

Adding New Records

Using Dialogs

Creating Child Records in a Dialog

Editing Child Records in a Dialog

Using Popups

Using Compact Margins

Creating a Search Screen

Filtering the List Control

Extending Your Application with JavaScript

Using the LightSwitch JavaScript API

Attaching JavaScript Code

Setting Default Screen Values

Setting the Screen Title

Hiding Controls

Accessing Data in Code

Deleting Records

Setting a Custom Command Icon

Accessing Screen Data Collections

Validating Data

Adding Custom HTML to Screens

Using Custom Controls

Showing Data with Custom Controls

Running Code When Data Changes

Replacing Default Controls with Custom Controls

Executing Queries

Working with Documents

Uploading Files

Downloading Files

Customizing the Appearance of Your Application

Applying Themes

Creating Your Own Themes

Changing the Application Icon and Title

Securing Your Application

Securing Methods

Summary

images Chapter 9: Creating and Using RIA Services

Creating an RIA Services Project

Creating an Entity Class

Creating a Domain Service Class

Retrieving Data

Retrieving a Connection String from web.config

Updating Data

Calling SQL Stored Procedures

Consuming Your RIA Service

Summary

images Chapter 10: Sharing Data with OData

What Is OData?

Using External Data Sources

Finding Third-Party Data Sources to Use

Determining Connection Settings

Connecting to an OData Data Source

Understanding Default Data Source Options

Exposing Your LightSwitch Data via OData

Finding Your Application’s End Point URL

Querying OData

Securing OData Feeds

Consuming LightSwitch Data

Connecting to LightSwitch Data from Excel

Connecting to LightSwitch Data from .NET

Connecting to Use LightSwitch from Other Platforms

Summary

images Chapter 11: Creating and Using Custom Controls

Using Custom Controls

Specifying a Custom Control

Binding Data to Custom Controls

Binding Data Collections to Custom Controls

Converting Values When Data Binding

Creating a Custom Silverlight Control

Understanding Dependency Properties

Creating a New Control and Dependency Property

Binding Dependency Properties to the Data Context

Applying the Duration Control on a Screen

Calling Custom Control Methods via Dependency Properties

Calling Screen Code from a Custom Control

Summary

images Chapter 12: Creating Control Extensions

Using LightSwitch Extensions

Installing LightSwitch Extensions

Using the Many-to-Many Data Control

Preparing Your Computer to Develop Extensions

Understanding Custom Control Types

Creating Value Controls

Specifying Which Data Types to Support

Supporting the FindControl Method

Setting the Control Icon

Running and Deploying Your Extension

Setting Product/Installation Attributes

Creating a Detail Control (ComboBox)

Setting the Control’s Metadata

Finding the Summary Property for an Entity

Creating a Helper Class

Creating Custom Property Editors

Customizing Visual Studio’s Property Editor

Customizing the Runtime Designer

Creating a Group Control Extension

Setting the Visibility of Labels

Creating a Command Control Extension

Summary

images Chapter 13: Creating Data and Presentation Extensions

Creating a Business Type Extension

Associating Custom Controls with Business Types

Enforcing Validation

Creating Custom Property Editor Windows

Using Your Business Type

Creating a Custom Shell Extension

Preparing Your Project

Defining the Look of Your Shell

Binding Data to Your Shell

Displaying Your Application’s Logo

Adding Code That Supports our Custom Shell

Managing Screens

Persisting User Settings

Setting the Name and Description

Using Your Custom Shell

Creating a Custom Theme Extension

Applying a Different Font

Setting Different Colors

Creating a Screen Template Extension

Setting Template Properties

Defining the Data Source Type

Generating Screen Controls

Generating Screen Code

Creating More Complex Screen Templates

Creating a Data Source Extension

Creating an Entity Class

Creating the Data Service Class

Using the Data Source Extension

Summary

images Chapter 14: Creating Reports

Choosing a Reporting Option

Using ASP.NET to Create Reports

Creating an ASP.NET Project

Adding an ASP.NET Page

Creating Charts

Securing Reports

Deploying Your ASP.NET Application

Using Microsoft SQL Server Reporting Services

Installing Reporting Services

Creating Reports

Linking Reports to LightSwitch

Opening Reports in a New Browser Window

Displaying Reports Inside a LightSwitch Screen

Printing Reports

Opening Reports in an HTML Client Application

Creating Reports with Microsoft Word

Performing Simple Automation

Performing Mail Merges with Word

Creating Adobe PDF Documents

Using Other Third-Party Solutions

Summary

images Chapter 15: Sending E-mail

Choosing How to Send E-mail

Sending E-mail by Using Server-Side Code

Sending E-mail When Data Changes

Making Your E-mail Code Reusable

Using Configuration Settings to Save Credentials

Triggering Server E-mail from an Onscreen Button on the Client

Sending E-mails with File Attachments

Creating Mail in a Pickup Folder

Sending Mail via Outlook by Using COM Automation

Opening the Default Mail Program

Using mailto in a Silverlight Client

Using mailto in the HTML Client

Calling External Resources from LightSwitch Clients

Using AJAX from the HTML Client

Calling Web Services from the Silverlight Client

Summary

images Chapter 16: Authenticating Your Users

Choosing an Authentication Method

Disabling Authentication

Enabling Windows Authentication

Enabling Forms Authentication

Understanding Where User Details Are Stored

Changing the Password Complexity Rules

Changing Password-Encryption Settings

Sharing Forms Authentication Data with ASP.NET

Allowing Users to Log Out of Web Applications

Summary

images Chapter 17: Authorizing Your Users

Applying Permissions

Defining Permissions

Setting Up Administrators Who Can Manage Users

Debugging Permissions

Applying Table-Level Access Control

Applying Screen-Level Access Control

Applying Query-Level Permissions

Specifying the Application Administrator

Creating and Managing Roles

Custom Authorization Examples

Associating Logins with Your Data

Opening Screens Conditionally at Login

Restricting Row-Level Access to Data

Setting Screen Control Properties by Permission

Allowing Users to Bypass Validation

Summary

images Chapter 18: Deploying Your Application

Getting Started with Deployment

Choosing an Application Topology

Choosing Whether to Publish or Package

Setting Up Your Workstations

Setting Up SQL Server

Using the Publish Wizard

Data Connections Page

Prerequisites Page

Security Page

Digital Signature/Certificate Page

Setting Up Your Web Server

Setting Up IIS on Windows Server 2008/2012

Setting Up IIS on Windows 8, 7, or Vista

Setting Up IIS 6 on Windows 2003

Setting Up IIS Application Pools

Configuring SQL Server Windows Authentication

Configuring Secure Sockets Layer (SSL)

ASP.NET Configuration

Installing the LightSwitch Server Components

Installing the Packages

Installing a Two-Tier Desktop Application

Installing a Three-Tier Browser and Desktop Applications

Three-Tier Manual Deployment

Deploying Data

Updating an Application

Troubleshooting Deployment Errors

Tracing Your Application

Deploying to Azure

Connecting Visual Studio to Azure

Choosing an Azure Service Type

Creating a Database

Completing the Publishing Process

Publishing to SharePoint

Summary

images Appendix A: Culture Names

images Appendix B: Data Type Identifiers

images Appendix C: Using Properties in Custom Controls

images Appendix D: Custom Screen Template View IDs

images Appendix E: HelpDesk Tables

HelpDesk Tables

External Tables

Database Diagram

Index

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.60.249