Saturday, April 7, 2012

Make It Look Pretty!

One of the features I love about LightSwitch is the fact that it's extensible.

For instance if your not happy with the look and feel of the default Theme and Shell that comes with LightSwitch right out of the box, your free to download a new Theme and Shell extension to change how your application looks and feels.

You can even create your own extensions, if you have Microsoft Visual Studio Professional or above.

Themes:
You have a gambit of choices when it comes to Theme's now.
All you have to do is spend 5 minutes in the Visual Studio Extension Gallery for LightSwitch and you will find a range of Theme's for fee or free by:
And many more.

These pre-built Theme's work great and are visually appealing but they don't always fit every client's needs and usually you can't modify them.

Ex.  One of my clients is a Fortune 500 Corporation that goes to great lengths to protect it's brand at every level of the organization. For whatever project they ask me to develop, whether it's to be a publicly facing website or application or if it's only going to be used by the clients internal employees it must adhere to the clients branding guidelines. i.e. Their Corporate colors, fonts and styles, are all very important to my client. You can't just use any old Theme for your project.

You could develop your own theme extension to your clients specs, which is a very worth while excersise but you have to have Visual Studio Professional or above, but thanks to Jan Van der Haegen, there is another great alternative.

Jan has released a free extension that allows you to change the theme in both Visual Studio LightSwitch 2011 (standalone version) and Visual Studio Professional or above with LightSwitch.

LightSwitch Extensions Made Easy by Jan Van der Haegen

If you haven't downloaded and played around with this extension you owe it to yourself to give it a try.

* Make sure you download the Sample file too from Jan's blog, this can be found by following the link appropriate for your installation on the

LightSwitch Extensions made easy Gallery page under Description

Choose your version  with Microsoft Visual Studio Professional / Premium / or
, change some of the settings within the MyTheme.xaml file, you can find this file by selecting File View, then navigate to the Client folder.

If you want to include this extension in your own project, open your Properties screen and navigate to the Extensions section, find the LightSwitch Extensions Made Easy and make sure the check box to the left is checked. Then change to File View, right click the Client folder, select Add Existing, then navigate to the sample projects Client folder and select the MyTheme.cs and MyTheme.xaml files.

What can you accomplish:
Anything your imagination can imagine related to themes of course,  for instance:

Note: 
About the following example, I loaded the Extension into my project
Here's the default screen, with no edits to the MyTheme.xaml file



New Theme after a few tweaks:



Your might be saying SO! 
Well! I just made a few color changes in the xaml file, saved and relaunched the application - took me less than 5 minutes. I didn't have to recreate the extension and re-install it, I saved the xaml file as you normally would with any of your project files and relaunched the project I'm working with. Nice!

Disclaimer:
 I took the time to go through the MyTheme.xaml sections in the sample file and made a change here and there to familiarize myself with what went to where beforehand.



If you need more control over your theme, Jan's extension is a great way to spice up your application quickly, efficiently and effectively.

Please Note: This extension can help you not only with Themes but Commands, Navigation i.e. (Deep Linking) , so be sure to read the LightSwitch Extensions made easy Gallery page under Description , Jan has links to his articles to help you with the additional features.

Hope this helps

- Keith

.NetCore 2.0, AzureAD and OpenIdConnect

.NetCore 2.0, AzureAD and OpenIdConnect If you develop with .NetCore you probably already know that there are some significant changes fr...