Microsoft released a beta of Lightswitch the other day. Here I’m going to do a run through of creating a simple application. I’m doing this without having read much of anything about Lightswitch.
So, choosing this project template and after a bunch of churning, we get presented with this:
Since this is a fresh new application, we’ll choose to create a new table. Doing so, we are presented with this:
Let’s just make a simple contact table and later build from that.
Notice that there are properties associated with the entity that we are creating. I’m guessing the properties on the generated class will be decorated with attributes from the DataAnnotations namespace.
For the State property, we’ll add a “Choice List” with a few states in the USA:
Next we’ll create a “screen” from the “Add” bar.
Before we do, let’s rename the “table” to “Contacts”
We’ll choose “List and Details Screen”, change the screen name to “ContactListDetails” and choose “Contacts” for the screen data:
We are now presented with this:
Ok, so let’s build it and run to see what we get.
Not bad for about 10 minutes worth of work.
Next we’ll play around with this form and see what else we can do. There was no code written for this at all. We’ll dig into the files that are created with this project and see what is generated behind the scenes. Switching from the Logical View to the File View, we can see that there is a hierarchy of files to look into.