Book Image

Microsoft .NET Framework 4.5 Quickstart Cookbook

By : Jose Luis Latorre
Book Image

Microsoft .NET Framework 4.5 Quickstart Cookbook

By: Jose Luis Latorre

Overview of this book

With about ten years since its first release, Microsoft's .NET Framework 4.5 is one of the most solid development technologies to create casual, business, or enterprise applications. It has evolved into a very stable framework and solid framework for developing applications, with a solid core, called the CLR (Common Language Runtime) Microsoft .NET Framework 4.5 includes massive changes and enables modern application and UI development."Microsoft .Net Framework 4.5 Quickstart Cookbook" aims to give you a run through the most exciting features of the latest version. You will experience all the flavors of .NET 4.5 hands on. The “How-to” recipes mix the right ingredients for a final taste of the most appetizing features and characteristics. The book is written in a way that enables you to dip in and out of the chapters.The book is full of practical code examples that are designed to clearly exemplify the different features and their applications in real-world development. All the chapters and recipes are progressive and based on the fresh features on .NET Framework 4.5.The book will begin by teaching you to build a modern UI application and improve it to make it Windows 8 Modern UI apps lifecycle model-compliant. You will create a portable library and throttle data source updating delays. Towards the end of the book, you will create you first Web API.
Table of Contents (19 chapters)
Microsoft .NET Framework 4.5 Quickstart Cookbook
About the Author
About the Reviewers

Adding a splash screen (and app tiles) to our app

So, we have an application and want to take full advantage of the Windows Store app style design, right? One of the easiest ways of accomplishing this is to provide a splash screen.

Getting ready

We should have an application ready, such as the previous recipe app. Any app will do. In fact, you can create an empty project and you will be ready to start this recipe.

How to do it...

Here we are going to take some steps to provide our app with a splash screen and app. tiles. There are some predefined places in our app that we can customize with default images.

  1. We will put an image in our splash screen that consists of a background color and an image of 620 x 300 pixels. We already have a default image, SplashScreen.png, in the Assets folder so we will need to replace this image with our own.

  2. We will also prepare our application logo in three flavors, 150 x 150 pixels for our main logo, 50 x 50 pixels for our store logo, and 30 x 30 pixels for our small logo image.

  3. Additionally, we can add a Wide Logo image to display when the application goes on expanded mode, in which case our tile doubles its space. Thus, we must make a tile of 310 x 150 pixels.

  4. Next, we will add the images to our Assets folder, replacing the current predefined placeholder images with the new ones for our project.

  5. Following that, we will open the Package.appxmanifest file with the manifest designer; a double-click on the file will do. Add a reference at the Wide logo section of our new wide logo. Then we will change the Show name section to No Logos, as our logo will showcase the application name. And finally we will change Background color to #FFFFFF.

  6. We will deploy our solution to see how it fits in the Windows 8 UI. We should locate quickly our application tile, select it and make it larger, and launch it to see our brand new custom splash screen.

    The custom splash screen after launching will look something like this:

How it works...

We just added some graphical assets and changed completely how the application looks in the Windows 8 UI, re-styling it and providing it with a bit of branding. Our app is now much closer to the Windows Store app design style.

We have also shown how easy this is and explained some of the properties from the Package.appxmanifest file.

There's more...

We could use additional splash screens for 1.4x and 1.8x scaling if we want better adaptation for higher resolution displays.

We could also capture the SplashScreen.Dismissed event and react quickly to it, for example, to provide a follow-up screen that mimics the splash screen while our application loads.

This behavior would be beneficial if the application has to perform some processing or data loading/caching before providing control to the user.

The official Microsoft Developer Network (MSDN) splash screen sample, for example, exhibits this precise behavior.

Another option would be to start the transition to our application's main screen after the SplashScreen.Dismissed event.