light-up-your-out-of-the-box lightswitch application
DESCRIPTION
LightSwitch Extensions. How to light up your out-of-the-box LightSwitch Application. Presented at CodeCamp NYC 2011-10-01 at Pace University Park Row.TRANSCRIPT
Boulos Dib
October 1, 2011
Boulos Dib - @boulosdib Independent Consultant – Napeague Inc. Software Development since 1983 First Personal Computer 1980 – TRS-80 III First Z80 based product (EPROM based Protocol Adpator – 1984) First Commercial PC-DOS product (Telex on IBM PC, 50 Baud – 1985) Started 16-bit Windows Development using Win 3.1 Developed on: 8080/Z80, 68xxx, PDP/RSX,VAX-VMS and x86/x64
(C/C++/C#) Develop in: ASP.Net, SilverLight, SharePoint I also have a life
Favorite sport – Windsurfing Favorite hobby – Playing my sunburst Fender Stratocaster+ guitar. Favorite guitar players
Wes Montgomery, Larry Carlton and Ritchie Blackmore (Deep Purple, Rainbow)
Thank You – Marquee Sponsor
Thank You – Platinum Sponsor
Thank You – Platinum Sponsor
Thank You – Gold Sponsor
Thank You – Gold Sponsor
Thank You – Gold Sponsor
Thank You – Gold Sponsor
Thank You – Gold Sponsor
Thank You – Gold Sponsor
Thank You – Silver Sponsors
Thank You
Greg Shackles For creating the Code Camp Mobile
App
For Providing me with the raw data for my sample
Agenda LightSwitch Overview
Demo Simple OOTB LightSwitch Application
Survey Extensibility Model and Options
Demos
Consume Silverlight Extension
Consume Silverlight Custom Control
Create a LightSwitch Theme Extension
Wrap-up
Assumptions Familiarity with .Net Development.
You can develop a simple application in C# (or VB.Net) using Visual Studio.
Have some understanding of Silverlight.
What is Visual Studio LightSwitch Simplest Development Environment for creating Line
Of Business Applications (LOB)
Able to consume data from Databases, SharePoint, and WCF RIA Services.
Can run as a web application or as a desktop application
LightSwitch Web Applications can be deployed locally or in Windows Azure WebRole.
Why LightSwitch? Simple(r) development tool.
Silverlight based infrastructure
Advanced development skills not required to build applications.
Based on Entity Framework
Easy deployment to IIS and Azure
Connectivity to SharePoint
Consumer of SQL Server and Other Databases
Consumer of almost any data source via custom WCF RIA Services.
LightSwitch Development
Start
Describe your data
Create screens for common tasks
Refine
Author business logic
Customize screen layouts
Define custom queries
Extend
Explore ecosystem
Create Custom Silverlight Controls
Integrate With Custom Data Sources
LightSwitch Architecture
Methods Controls Screens
Data Workspace
Submit Pipeline Queries
Data Workspace
Data Access Middle Tier Client Tier
LightSwitch Building Blocks LightSwitch VS Pro Ecosystem
Demo – Simple LightSwitch Application
Data and Screens
Screens are automatically generated based on entities.
Queries for both Entities and Screens
Business Logic
Demo
Simple LightSwitch Application
Beyond Simple LightSwitch Development
Even with LightSwitch, developers can access LightSwitch APIs, Silverlight and the .Net Framework
Including
Custom Screen Layouts
Save Pipeline, Validation & Access Control Hooks
Customize Complex and Composite LINQ Queries (i.e. EntityName_All EntityName_Single)
Client and Server Project Code
COM Interop
Publish to IIS or Windows Azure
Extending LightSwitch Utilize .Net Assemblies
Incoporate Silverlight Controls
Add LightSwitch Extensions
Amazing Third Party Extensions
Great Open Source and Community Driven Extensions
Roll Your Sleeves and Build your own
Requirements for Building Extensions
Visual Studio Pro or Ultimate + SP1
Visual Studio LightSwitch
Visual Studio SDK
Needed to build VSIX packages
LightSwitch Extension Toolkit
Extensions - Ecosystem You do not need to build extensions, there are many
available and the list is growing. Vendors
ComponentOne - OLAP for LightSwitch DevExpress – DXEditors & XtraReports for LightSwitch FirstFloor – Document Toolkit for LightSwitch Infragistics – NetAdvantage for Visual Studio LightSwitch Telerik – Rad Controls for Silverlight RSSBus – Data Providers for: Google, PowerShell, Facebook,
Quickbooks, Salesforce, Sharepoint, Twitter
Community Driven Look in the Gallery….
LightSwitch Extension Types Silverlight Controls
Screen Templates
Business Types
Themes
Shell
Custom Data Sources
Extension Projects Project Purpose
Client Contains client implementations that should be deployed with a LightSwitch application but are not found in the Common project. For example, controls, shells, and themes.
Client.Design Contains implementations necessary during the debugging of a LightSwitch application. For example, control images or custom property editors for the runtime screen designer.
Common Contains implementations that are common to both the client and the server. For example, metadata loaders and validators.
Design Contains implementations for design time integrated development environment (IDE) operations. For example, a screen template.
Server Contains server implementations that should be deployed with a LightSwitch application but are not found in the Common project. For example, data sources.
Project Purpose
.Lspkg .Lspkg packages the above five projects so that LightSwitch can unpack and reference them when the package is installed
.Vsix .Vsix project packages the generated .Lspkg file into a .Vsix package so that it can be added to LightSwitch through the Extension Manager
Using Extensions Installing Extensions
Manually double-clicking a VSIX package.
Extension Manager Within Visual Studio Pro ++
Visual Studio RESTART almost always required.
For Shell and Theme Extensions:
Activate Extension by Opening Project Properties and check the Extensions tab.
To Apply a theme or a shell, Open the same Project Properties and theme or shell in the General properties.
Creating a Theme Extension We will create a theme
Modify few resources
Test it against a simple application
Using Silverlight Custom Controls Easier to use than writing
Do not know anything about LightSwitch
There 2 possibilites Build a control for a specific entity (VM) and bind it to a
specific entity - less code but not re-usable. Can not be used for any other entity or data.
Build a control and bind the code in the LightSwitch code – More lightswitch code but Silverlight Control can be re-used across screens and applications.
Demo – based on Code Magazine article by LightSwitch team member Karol Zadora-Przylecki
References Andrew Brust – LightSwitch White Papers
http://bit.ly/pjD6Ke
Michael Washington
http://lightswitchhelpwebsite.com/
Code Magazine July/August 2011
Using Custom Controls to Enhance LightSwitch Application UI by Karol Zadora-Przylecki
Visual Studio Gallery http://visualstudiogallery.msdn.microsoft.com/site/search