By Michael Washington on 5/23/2011 5:37 AM
NOTE: If you are using LightSwitch 2013 Update 2 (or higher) you must add compatibilityMode="Framework20SP1" to the "machineKey" in the LightSwitch Web.config (for example: http://blogs.msdn.com/b/webdev/archive/2012/10/23/cryptographic-improvements-in-asp-net-4-5-pt-2.aspx

image

Note: You can try out this application...
By Michael Washington on 5/22/2011 8:53 AM
image

From: Microsoft Visual Studio LightSwitch Extensions Cookbook.doc © 2011 Microsoft Corporation NOTE: See the updated article: Creating a Minimal LightSwitch Shell A LightSwitch application runs in a “Shell”. You can create your own Shell.

The first step is to download the “Cook Book”...
By Richard Waddell on 5/21/2011 8:29 AM
 

image

LightSwitch removes so much tedium from programming that I’m hoping it can be integrated into any Silverlight application. Obviously that requires Custom Controls, so the focus becomes finding the best patterns for interaction between LightSwitch and Custom Controls.

My first goal was to incorporate drag and drop. I spent a lot of time trying to come up with scenarios that were not trivial but also wouldn’t take a long time to set up. But I kept running into a fuzzy area when I tried to think about...
By Michael Washington on 5/21/2011 6:19 AM
image

 

Note: There is a third method covered at this link.

It is easy to create a LightSwitch application using your own custom user interface (UI), composed entirely of Silverlight Custom Controls. The article This Is How LightSwitch Does MVVM,...
By Michael Washington on 5/19/2011 5:34 AM
image

The Document Toolkit for LightSwitch is a commercial LightSwitch control extension. It is one of the first to become available, and is a great example of an extension that allows you to do amazing things easily with LightSwitch.

image

...
By Michael Washington on 5/13/2011 9:46 PM


This article, Silverlight View Model Style: An (Overly) Simplified Explanation, explains what MVVM is. Basically:

Model – The Data View Model – Collections, Properties, and Commands View – The UI (User Interface) This article, covers some of the problems in implementing MVVM, mostly that is is verbose,  time-consuming, and difficult for many developers to understand and implement. That is not to say that MVVM is not a superior pattern once you have mastered it, but using a tool such as LightSwitch greatly eases it’s use.

image

...
By Michael Washington on 5/12/2011 5:25 AM

With LightSwitch, there is no built in Printing. Here is a method that works. This will also show you how to create a custom template to allow you to print exactly what you want, not just the current screen...
By Michael Washington on 5/12/2011 4:19 AM
image

Printing in LightSwitch was previously covered here:

http://lightswitch.adefwebserver.com/Blog/tabid/61/EntryId/3/Printing-With-LightSwitch.aspx

The disadvantages of that approach are:

You have to make a custom control / You have to be a programmer to make reports Printing in Silverlight renders images that are slightly fuzzy In this article, we will demonstrate creating and printing reports in LightSwitch using Microsoft Report Viewer Control.

Note, you will need Visual Studio Professional, or higher, to use the method described here.

...
By Michael Washington on 5/8/2011 7:01 AM
The LightSwitch filter extension is really cool. It is one of the LightSwitch features that has no comparison. It is a feature that, if you decide not to use LightSwitch for a project, you lose that feature completely.

image

First, we download and install the extension at this link:

http://code.msdn.microsoft.com/Filter-Control-for-Visual-90fb8e93

image

...
By Michael Washington on 5/6/2011 5:19 AM
I was surprised when I was chosen to present at Visual Studio Live in Las Vegas early this year. I had sent in 3 proposed topics months before, and the one chosen was Advanced LightSwitch Programming. After being informed of my selection to speak at the conference, I sat down to create the presentation and ran into a huge problem. There is just too much to cover about advanced LightSwitch programming to cram into 75 minutes.

I really agonized over this, and re-wrote the presentation several times. In the end, I spent over 40 hours preparing and practicing the presentation. The only structure I was happy with, was coving LightSwitch programming using three concepts that I felt were important to successful LightSwitch programming.

These are presented in order of importance.

Concept #1 - LightSwitch requires you to only write the code that only you can write Examples of the concept:

A calculated field that shows the course and the teacher...
By Richard Waddell on 5/5/2011 5:40 PM
Often we don’t care who the logged-in User is because we can control what they can do through Roles and Permissions. But if the User is a member of some group, it would be handy to place the Users table in a many-to-one relationship with that group. In this example the groups are SalesTeams made up of SalesPersons. All Sales made by a particular team are accessible only by members of that team.

To make that happen a new User is created, if necessary, when a SalesPerson is created. Since a SalesPerson is in a many-to-one relationship with SalesTeam, so is the User. This article shows you how to create the UserRegistration and then two ways to identify the SalesPerson associated with the logged-in User and thereby the relationship with SalesTeam and Sales.

Start by adding a SalesTeam entity:

image

...
Microsoft Visual Studio is a registered trademark of Microsoft Corporation / LightSwitch is a registered trademark of Microsoft Corporation