LightSwitch in Visual Studio 2012 Proves Effective as RAD Tool

By Jeff Cogswell  |  Posted 2013-02-12 Print this article Print

This is where I got a bit confused at first, until I realized the whole navigational approach to the LightSwitch apps. Unlike a traditional HTML app where you might create a page with links to other screens, here you have to first create a “home” screen. These screens aren’t just HTML pages. Rather, they’re visual representations of some part of the data (i.e. the “presentation”). So for my Netflix app, I started with a Browse screen and attached it to the Genres table.

At this point, I stopped and ran that application so I could see the defaults. Sure enough, I saw a list of all the Genres. I couldn’t yet drill down into the data, but it appeared in the browser.

But it was a bit strange looking. It wasn’t like the grids that were available in the older Silverlight versions. Instead it actually looked sort of like something you would see on a smart phone. But it turns out there’s a reason for that: Behind the scenes, the Lightswitch HTML apps are powered by jQuery Mobile. It’s hard to say exactly why Microsoft chose this approach, but my suspicion is they want us building apps that are more for phones and tablets.

The apps run using the new IIS (Internet Information Server) Express, although you can wire them into the IIS server by installing the LightSwitch runtime extensions. However I haven’t tested that feature yet. What I did try out, however, was configuring my firewall and then using my iPhone to connect to my app.

It worked, but it involved a hack of sorts. I had to go into the IIS Express’s configuration XML file and change the domain name to allow all incoming domains, not just localhost. Once I did that, I put my computer’s IP address and the app’s port number into the iPhone browser and there it was. It looked good on the phone, too.

You can also use the built-in designer (which is not a WYSIWYG designer) to customize your screens even more. For example, instead of displaying data in rows, you can display your data in a block format that looks—no surprise—very much like the new Windows 8 interface with colored boxes.

In order to add drill-down capabilities to my NetFlix screen, I had to first create a second screen that shows the details. Since my main screen shows genres, the details for a genre will show the titles for that genre. To do so, I clicked the Add Screen menu and quickly created another screen, this time again choosing Browse Data Screen, but this time for the data I chose the Titles table.

The next step is to cause the Titles screen to open when I click on an individual genre in the home Genre screen. This again shows where Microsoft’s focus is for app development. You don’t add a “click” event as you do in other development platforms. Here, you add a “tap” event. Yes, that’s a tiny technicality, but it does indicate Microsoft expects that future development will be concentrated on tablets and mobile devices.


Submit a Comment

Loading Comments...
Manage your Newsletters: Login   Register My Newsletters

Rocket Fuel