Category Archives: Cloud Business Apps

Section Expanders in LightSwitch HTML

Section Expanders in LightSwitch HTML

Section Expanders in LightSwitch HTML

Overview

Apps created with LightSwitch HTML client are mobile first as the UI is based on jQuery Mobile. This post introduces a way to organise form data with section expanders that are often found in desktop app scenarios.

Default Mobile First Style

In the mobile style of pages the data is typical displayed in one or two columns and related data is visualized in tab sections. Here is an example of a default View screen with details on the first tab and related information located on separate tabs.

Tab Sections in LightSwitch HTML

Tab Sections in LightSwitch HTML

In many ways the styling is a matter of taste and there are several ways of presenting larger volumes of information in common use. Using the in-built View Details Screen template the screen content layout looks like this:

View Details Screen Layout

View Details Screen Layout

The screen content is organized into parent tabs and the tab layout uses the Columns and Rows Layout controls.

Designing the Layout and Behaviour

In desktop application scenarios the answer to how to display large amounts of data fields has often been to use section expanders. Very often for line-of-business apps a combination of tabs, expanders and pop-ups is used to try and provide an optimal user experience.

If you want to give your LightSwitch apps a more Desktop UX feel there is nothing stopping you from implementing similar styles and behaviours.

The first step is to organise the screen content layout into sections. Each section will have a visible border box to group related information. The first header section in this example will be static. Subsequent sections will be expandable and will be displayed by default as collapsed.

Screen Content Layout for Expanders

Screen Content Layout for Expanders

The sections are marked up: Header, Attributes and Tracking

The expandable sections contain a custom control for the expander header and the rest of the section content is (Not Visible) to start. Let us take the first example above, with the layout hierarchy:

Expander Content Items Layout

Expander Content Items Layout

The section’s top Rows Layout will:

  • Handle _tap event to toggle the section details visibility

The section’s Custom Control will:

  • Render the expander header

The section details Rows Layout will:

  • Block _tap events from bubbling up to its parents
  • Display the section border box in _postRender

Implementing the Expander

Firstly we will attend to the rendering of the expander header:

Render Expander Header Custom Control

Render Expander Header Custom Control

I have set all the CSS attributes in the _render code here for directness. You should really use a custom CSS class. You can experiment with the CSS attributes for different visual impact. The sample variable _attributeExpanderHeader should be scoped to the screen. You could include icons as part of the visual feedback.

Then complete the visual changes by adding code to the section details group content item like this:

Expander Section Details

Expander Section Details

The CSS styles place a border box around the sections details. The Tap action is bound to showTab Details – this stops the tap event bubbling up.

Then finally on to the section’s top level group control to handle the tap event to expand and collapse the section details.

Toggle the Expander Section Visibility

Toggle the Expander Section Visibility

The toggle event flips the isVisible setting and handles the rendering of the bottom border of the expander hander. You could experiment with icons here.

Conclusion

With a little screen content layout design work, some CSS styles and a toggle event you can introduce section expanders to you control portfolio in LightSwitch TML client apps.

Tab Header Styling in LightSwitch HTML Apps

Tabs Style in LightSwitch HTML App

Tabs Style in LightSwitch HTML App

Overview

The default appearance of the tab headers in your Cloud Business Apps and LightSwitch HTML Apps can be customized to make them look more appealing and looking a lot more obvious to the end-users.

This post shows you which CSS classes and attributes to change to achieve tab headers that look like retro card index tabs.

Examples and Samples

This is the style of tab headers that we will show to create.

Rounded Corner Tabs Styling

Rounded Corner Tabs Styling

Some simply rounding of a corner can give a card index file type appearance.

Casrd Index File Style Tabs

Card Index File Style Tabs

The CSS styling customizations required can be made in one place that is then picked up by all screens and pop-up dialogs. Here is a similar styling in another app but with a more rounding to blend in with the apps style.

Round Tab Headers

Round Tab Headers in a Pop-up Dialog

You can see the visual impact readily. Clearly you can use any HTML5 CSS styling that you like once you have access to the classes and elements. The simplest way to do this is to override some of the CSS styling by editing the ‘user-customization.css‘ file located in the HTML Client ‘Content‘ folder.

user-customization.css in solution explorer

user-customization.css in solution explorer

At the top of this file you can add a section to change the styling of your project’s tab headers. Here is the first example:

msls-screen-tab css class

msls-screen-tab css class

The CSS classes involved are:

  • msls-screen-tab
  • msls-screen-tab-active
  • ui-btn-inner

In this case the border-top-right-radius is setting the rounding effect. The CSS attributes needed will vary based on the complexity of your apps style sheets. In this example the existing style sheets have no border rounding.

In the second sample, where the app’s border styling is already rounded, a few more attributes need to be overridden for the full effect.

msls-screen-tab complete border rounding

msls-screen-tab complete border rounding

In this case the border top left radius continues to be inherited from the main style sheet and so matches the apps other visual elements, such as buttons. The top right border is given more rounding to extenuate the visual effect of a card index header. To finish the look, the apps default rounded styling is overridden in the bottom border corners.

You can experiment with other attributes from font properties to background effects.

Conclusion

A simple way to add a bit of card index style to your tab headers. Not all Cloud Business Apps and LightSwitch HTML Apps need to look the same.

Visual Studio 2015 and LocalDB instance for LightSwitch

Purpose

With Visual Studio 2015 RTM the database tooling has changed. How LightSwitch uses LocalDB has changed too. Remember the issue with VS2013 and LightSwitch SQL Server Project references being blank? Let us take a look and see what changed in this area and determine if LightSwitch and SQL Database Projects work better together.

Background

How and why have things changed with LocalDB? I will refer to this Microsoft Connect feedback from 2014:

SQL Server 2014 Express LocalDB does not create automatic instance v12.0

In SQL14, we moved away from the numbering/versioning for the automatic instance and named itMSSQLLocalDBinstead of “v12.0”. The name of the automatic instance in the SQL14 documentation for LocalDB at http://msdn.microsoft.com/en-us/library/hh510202(v=sql.120).aspx has been fixed. If you require an instance to be named “v12.0”, you can create a named instance with that name.
Thanks & Regards, Pooja Harjani, Sr. Program Manager, SQL Server, Microsoft.”

A SQL 2014’s Local DB sample connection string looks like this:

Data Source=(localdb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\mydb.mdf;Initial Catalog=mydb;Integrated Security=True;MultipleActiveResultSets=True

How this surfaces in LightSwitch

So, the name for the automatic instance is MSSQLLocalDB. This is the instance that LightSwitch in Visual Studio 2015 now uses to create intrinsic databases for projects.

Here is a screenshot of the SQL Server Object Explorer window in VS2015 showing two intrinsic databases underlying LightSwitch projects:

LightSwitch LocalDB use in Visual Studio 2015

LightSwitch LocalDB use in Visual Studio 2015

The ‘UserVoice‘ test project was created using VS2015 RC and is uppercase. The LightSwitch test project ‘ResearchDatabaseApp‘ was created using VS2015 RTM. This is where we can find our development time intrinsic databases.

Refer to SQL Server Data Tools RTM update for July 2015 blog post for final details with respect to Visual Studio 2015 RTM.

LightSwitch and SQL Database Projects

Next, I created a new SQL Database Project called ‘ResearchDatabase‘ in the same solution as the LightSwitch ‘ResearchDatabaseApp‘ project. Here is a screenshot showing the default target platform as SQL Server 2014.

LightSwitch-ResearchDatabase-project

Then moving to the LightSwitch project properties straight away we see:

LightSwitch SQL Database Project reference working in Visual Studio 2015

LightSwitch SQL Database Project reference working in Visual Studio 2015

The new project shows up immediately in the LightSwitch project properties. You can write scripts to manage the intrinsic database whenever you build or deploy the LightSwitch application. With post-deployment scripts, you can populate data, enhance the schema or add an index. Refer to the MSDN LightSwitch documentation for details: Managing the Intrinsic Database for LightSwitch.

Summary

So with Visual Studio 2015 and new LightSwitch projects the linking to SQL Database Projects is back working as it should! Another sign of continuing maintenance support for LightSwitch.

Visual Studio 2015 Launch – AIDE for LightSwitch sim-ships

We are happy to announce that a new release of AIDE for LightSwitch will sim-ship with VS2015 RTM. Xpert360 are Microsoft Partners in the VSIP program. We have committed to support VS2015 RTM within 30 days of release across all Visual Studio paid and free offerings.

AIDE Studio for LightSwitch

AIDE Studio for LightSwitch

With this refresh, all our LightSwitch desktop themes and theme packs are free for run-time use. The vNext AIDE will be made available as AIDE Studio 2015 with free-use Community and paid Enterprise editions. No more trial editions, a simplification in the licensing and packaging, fully integrated with Visual Studio Gallery for discovery and upgrades. Watch out for more announcements and materials in the coming weeks.

Today , Monday 20th July 2015 and it is time for the final release of Visual Studio 2015. The keynote starts at 08:30AM PST (UTC -7) so set your reminders

15:30 GMT/UTC  16:30 BST  11:30 EST  08:30 PST

The event includes 4 hours of live streaming of sessions via channel9 and 20 or so pre-recorded video sessions.

Live Visual Studio 2015 Final Release Event via Channel9 @ch9

The live streaming will give a great overview of getting started with Visual Studio 2015 , .NET 4.6 and Visual Studio Online. Packed with demo’s showing improved productivity, cross-platform development and new opportunities.

It is anticipated that the Visual Studio 2015 RTM will be announced as available to download. The VS2015 pre-RTM release has been with the Xpert360 Development Team for some time as we test and build the latest releases of our tools ready to Sim-Ship as a member of the Visual Studio Industry Partner program (VSIP).

The editions of Visual Studio 2015 available is different from previous release and you can compare the editions here. In our eyes the key change is availability of the Community edition continuing with support for LightSwitch and extensions available from the Visual Studio Gallery. This considerably expands the reach of the Visual Studio platform.

ooo

Company information: Xpert360 Ltd, founded in 2009, based upon three decades of IT experience, is an Independent Software Vendor and Custom Solution Provider based in the United Kingdom.

Xpert360 Lightning” and “AIDE Studio for LightSwitch” are trademarks of Xpert360 Ltd, copyright 2012 – 2015.