Light-up-your-out-of-the-box LightSwitch Application


Published on

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.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Light-up-your-out-of-the-box LightSwitch Application

  1. 1. Boulos DibOctober 1, 2011
  2. 2. 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)
  3. 3. Thank You – Marquee Sponsor
  4. 4. Thank You – Platinum Sponsor
  5. 5. Thank You – Platinum Sponsor
  6. 6. Thank You – Gold Sponsor
  7. 7. Thank You – Gold Sponsor
  8. 8. Thank You – Gold Sponsor
  9. 9. Thank You – Gold Sponsor
  10. 10. Thank You – Gold Sponsor
  11. 11. Thank You – Gold Sponsor
  12. 12. Thank You – Silver Sponsors
  13. 13. Thank YouGreg Shackles  For creating the Code Camp Mobile App  For Providing me with the raw data for my sample
  14. 14. 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
  15. 15. Assumptions Familiarity with .Net Development. You can develop a simple application in C# (or VB.Net) using Visual Studio. Have some understanding of Silverlight.
  16. 16. 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.
  17. 17. 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.
  18. 18. LightSwitch Development Start Refine Extend Describe your data Author business logic Explore ecosystem Create screens for Customize screen Create Custom common tasks layouts Silverlight Controls Integrate With Custom Define custom queries Data Sources
  19. 19. LightSwitch Architecture Screens Methods Controls Submit Pipeline Queries Data Workspace Data Workspace Client Tier Middle Tier Data Access
  20. 20. LightSwitch Building Blocks LightSwitch VS Pro Ecosystem
  21. 21. 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
  22. 22. 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
  23. 23. 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
  24. 24. Requirements for Building Extensions Visual Studio Pro or Ultimate + SP1 Visual Studio LightSwitch Visual Studio SDK  Needed to build VSIX packages LightSwitch Extension Toolkit
  25. 25. 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….
  26. 26. LightSwitch Extension Types Silverlight Controls Custom Data Screen Sources Templates Business Shell Types Themes
  27. 27. Extension ProjectsProject Purpose​ Contains client implementations that should be deployed with a LightSwitch application but are notClient found in the Common project. For example, controls, shells, and themes. Contains implementations necessary during the debugging of a LightSwitch application. For example,Client.Design control images or custom property editors for the runtime screen designer. Contains ​implementations that are common to both the client and the server. For example, metadataCommon loaders and validators. Contains implementations for design time integrated development environment (IDE) operations. ForDesign example, a screen template. Contains server implementations that should be deployed with a LightSwitch application but are notServer 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
  28. 28. 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.
  29. 29. Creating a Theme Extension We will create a theme Modify few resources Test it against a simple application
  30. 30. 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
  31. 31. References Andrew Brust – LightSwitch White Papers  Michael Washington  Code Magazine July/August 2011  Using Custom Controls to Enhance LightSwitch Application UI by Karol Zadora-Przylecki Visual Studio Gallery 
  32. 32. Thank You and Follow-up Contact:   @boulosdib