Nico's digital footprint

I grew up in the nineties, that makes me awesome by default

Building a basic Lightswitch application - Page 3

 

Notice that the list only shows the firstname of the hero, I don’t really like that, I want the hero name to be shown there, let’s fix it.

 

When the application is running in debug mode you will see a “Design screen” button in the upper right corner, when you click it, the application will pause and go in design mode, here we will change the list lay-out, but first a small theory lesson.

 

Lightswitch applications are build in Silverlight, a Silverlight UI is build using XAML and the power of XAML lies partly in nesting controls and that is exactly what we have here. In the List and Details screen we have a Grid with 2 columns, the left column contains a list and the list contains a summary item. The summary item is the firstname that we saw when running the application, we will switch it to a column lay-out.


initial screen
(click to enlarge)

 

So when we’re in the design mode, click on the small arrow of the summary item and select Columns layout. Notice that now all fields are shown, so delete all unnecessary columns and click the save button in the upper right corner.


initial screen
(click to enlarge)

 

Behold the result:


initial screen
(click to enlarge)

 

All right, sit back take a deep breath and relax. Let’s look back at what we’ve done in this short time, we’ve created a database with relationships, build a data driven application, added a UI that allows us to view, edit and add data.
All this, without writing any piece of code and that right there is the power of Microsoft Lightswitch.

 

What we’ve done here is barely scratching the surface of Lightswitch. You can dive into the code and extend it, write your own screen templates, add calculated fields, add data validation and so on. The possibilities are huge. Will this ever be used to create business size applications? I don’t now, future will tell, but what I can tell you is that it will never replace a competent developer, applications the size of those that I deal with daily can never be designed through a graphical environment like Lightswitch. So have no fear fellow developers world-wide, our services will always be needed J.

 

I hope you enjoyed this very basic explanation of Microsoft Lightswitch, please note that this is still beta software and as such does not represent the final product. As a final exercise, please try to add the city logic to the application yourself so our heroes can have cities to defend. You can find the source code, including the city logic, attached to this article.

 

If you have any questions, please leave a comment!

Download source code

 <-- Previous Page

  Log in

About the author

Hi,

My name is Nico, I’m an MCP living in Belgium.
I’m currently employed as a consultant in the Mobile Solution Center at RealDolmen, one of Belgium’s leading IT single source providers, where I focus on Windows Phone and Windows 8 development.

I'm also founding member and board member of the Belgian Metro App Developer Network, a user group focussed on Windows 8 and Windows Phone development. If you're in Belgium feel free to drop by if we're doing an event. http://www.madn.be

Since June 2012 I'm a proud member of Microsoft's Extended Experts Team Belgium. And in February 2013 I became a member of DZone's Most Valuable Bloggers family.

This blog will be about Windows Phone 7, C#, XNA , WPF, Silverlight, and much more!

I hope to get feedback from my readers either through comments, mail (nico_vermeir@hotmail.com), twitter, facebook, …

 

 

MeetLogo

 

MVBLogo

mybook

 

mybook

 

Month List