Wednesday, January 23, 2013

[C# and Win8] How to develop your first Modern UI application
Part 2: Source Code & Development

In the last part we discussed how to create your first Modern UI project and all the prerequisites for being able to start its development. In this part you will actually see, what developing this type of application really means.

Development of the Image Viewer application

For this tutorial we are going to create an Image Viewer application. The goal of this example application will be to display all the images in your local Pictures Library. You may reuse the skeleton project, that we have created at the end of the last blog post and apply the following steps to it.

Add some code that gets data from your local Pictures Library and execute your application. A best practice in Modern UI applications is to always use an asynchronous approach, which is why we use the GetFilesAync() method and the await keyword in the following example :

CodePicturesLibrary

You will see that there is an exception of type “System.UnauthorizedAccessException” :

Exception

Modern UI application do not have any access rights by default, which is why you get an error message, when trying to access your local Pictures Library.

So as first step you have to allow access to your Pictures Library. To do this you just have to double-click on the “Package.appxmanifest” file in the Solution Explorer. Then go to the Capabilities section and enable the checkbox “Pictures Library”. Save your modifications and there should not be any error message anymore, when you execute your application.

Capabilities

In the next step, add a new class ImageItem to the solution and implement the following code :

ImageItem

This class will be instantiated for each picture in your local Pictures Library. It contains the picture itself, the picture name and a short description.

Add a GridView to the “MainPage.xaml” file, that is going to be used for displaying the pictures from the local Pictures Library :

GridView

Here is an example implementation of the whole code that could be implemented for the Image Viewer application in the “MainPage.xaml.cs” file :

Example

When executing the application, you will get a display of all the pictures that are currently stored in your local Pictures Library :

Fig9_Image_Viewer

If there are no pictures you will get a message that there were no pictures found :

NoPictures

This concludes this part. I am going to show you how to further configure your applications in more detail, as well as how to publish them in the next parts of the series.


Share/Save/Bookmark

[C# and Win8] How to develop your first Modern UI application
Part 1: Prerequisits & Project Creation

This tutorial is going to show you how to develop Modern UI applications (also called Metro-style applications). You will see the different steps such as creation and configuration of the project, the development using Visual Studio 2012 and its deployment on the Windows Store.

Modern UI applications can be developed using multiples languages. So if you are experienced in web development (HTML5/CSS3), .NET application development (XAML/C#, VB, or C++) or DirectX application development (C++), you already have the necessary skills to develop your first application.

Fig1_Presentation_Modern_UI

There are multiple display modes for Modern UI applications. You should know that by default they are border-less and full-screen (but you may change that).

Modern UI applications may currently only run on the Windows 8 and Windows 2012 operation systems. But they are running on all devices that are compatible with those operation systems (Desktop PCs, Laptops, Tablets, etc…).

Prerequisites for Modern UI applications

To be able to develop you first Modern UI application you have to have some prerequisites in place. Here are the technical requirements :

  • Windows 8 (Professional or Enterprise) / Windows Server 2012
  • Visual Studio 2012 (Professional or Ultimate)
  • Developer License (see below)

That is all ! After installation of those products you are now able to create your first Modern UI application project.

Project Creation

Start Visual Studio 2012, make sure that .NET Framework 4.5 is selected and click on “New Project” (you may also do this from the menu by clicking on “File” / “New” / “Project”). Create a new project of type “Blank App (XAML)”, which you may find under the “Windows Store” section.

Fig3_Creation_Nouveau_Projet

If this is the first time you have ever created a Modern UI application, you will not have a valid developer license for Windows 8. But this is really no problem, since you may ask for one for free.

You now have to connect yourself with a valid Windows Live account, then the system will present you with the following dialog. Just click on “I Agree” and the developer license will be downloaded to your system.

http://lh6.ggpht.com/-pYBE-NOrx3Y/UEuWZnAwhJI/AAAAAAAAssA/_kClO4L7tDA/Mobile%252520Services%252520-%252520DeveloperLicenseDialog_thumb%25255B2%25255D.png?imgmax=800

If you already had a license but it is not valid anymore (licenses are currently only valid during 1 month), then you have to renew it. For being able to develop Modern UI applications you have to have a valid developer license all the time.

The skeleton of your new application gets now generated. In the next parts of the series we will continue with the actual development of the application and see how to debug and in the end deploy it.


Share/Save/Bookmark

Wednesday, January 16, 2013

[Publication] New ".Net Framework 4.5 Expert Programming Cookbook" Book is now available in English

I am happy to announce, that the English book “.Net Framework 4.5 Expert Programming Cookbook”, which I have technically reviewed, is now available in the Packt Publishing online store. You may buy it as eBook and paper book.

If you are interested in .NET 4.5, this book is for you since it contains everything necessary for you to master this technology quickly. Examples and explications provide thorough information on all new features. I personally have reviewed all of the examples and I hope they will give you all insights you expect.

.Net Framework 4.5 Expert Programming Cookbook

Here is the table of contents (look under the “Table of Contents” tab):

Preface
Chapter 1: Core .NET Recipes
Chapter 2: Application Events and Windows Forms
Chapter 3: Threading and Parallel Programming
Chapter 4: ASP.NET Recipes – I
Chapter 5: ADO.NET Recipes
Chapter 6: WCF Recipes
Chapter 7: WPF Recipes
Chapter 8: ASP.NET Recipes – II
Chapter 9: Silverlight Recipes
Chapter 10: Entity Framework Recipes
Index

If you have bought and read it, please let me know what you think.


Share/Save/Bookmark

Tuesday, January 15, 2013

[Publication] New "WCF 4.5 Multi-Layer Services Development with Entity Framework" Book is now available in English

I am happy to announce, that the English book “WCF 4.5 Multi-Layer Services Development with Entity Framework”, which I have technically reviewed, is now available in the Packt Publishing online store. You may buy it as eBook and paper book.

If you are interested in .NET 4.5 and WCF 4.5, this book is for you since it contains everything necessary for you to master those technologies quickly. Examples and explications provide thorough information on all new features. I personally have reviewed all of the examples and I hope they will give you all insights you expect.

WCF 4.5 Multi-Layer Services Development with Entity Framework

Here is the table of contents (look under the “Table of Contents” tab):

Preface
Chapter 1: Web Services and Windows Communication Foundation
Chapter 2: Implementing a Basic HelloWorld WCF Service
Chapter 3: Hosting and Debugging the HelloWorld WCF Service
Chapter 4: Implementing a WCF Service in the Real World
Chapter 5: Adding Database Support and Exception Handling
Chapter 6: LINQ: Language Integrated Query
Chapter 7: LINQ to Entities: Basic Concepts and Features
Chapter 8: LINQ to Entities: Advanced Concepts and Features
Chapter 9: Applying LINQ to Entities to a WCF Service
Chapter 10: Distributed Transaction Support of WCF
Chapter 11: WCF Security
Chapter 12: Extending WCF Services
Index

If you have bought and read it, please let me know what you think.


Share/Save/Bookmark

Wednesday, January 9, 2013

[TechDays 2013] Cellenza will be animating some sessions during the next Techdays in Paris

The biggest and most important Microsoft event of the year in Europe is not far away ! TechDays 2013, planned for mid-February in Paris, will provide thorough information on all current and upcoming Microsoft technologies. Many new technology trends will be presented. A must for everyone who is working in the software development sector. And the best of all : It is for free !

Microsoft TechDays - 12, 13, 14 février 2013 au Palais des Congrès de Paris

Cellenza has the honor to present some sessions during this glorious event. Here are the sessions that we are currently preparing :

I will act as ATE (Ask The Expert) and will be happy to respond to any questions you might have concerning Microsoft products during the breaks in between the different sessions.

You will find me at one of the stands wearing a special shirt and I will be happy to exchange with you on any technical subject you might have.

Don't hesitate, inscribe yourself quickly. See you at TechDays 2013 !!!


Share/Save/Bookmark

[Webcast] Cellenza in MS France Visual Studio BonApp Show

Cellenza has published a very interesting French Webcast on the Microsoft France BonApp Website. The speakers are Michel Perfetti (Cellenza) and Olivier Conq (Mediapost) and the subject is around Visual Studio 2012, TFS 2012, Agility and Software Development.

They explain how Visual Studio 2012 and TFS 2012 can aid you to apply Agility in your projects by sharing their own real life experiences.

The Webcast is called “Visual Studio 2012, enfin !” and you can find it here (or just view it below) :

http://www.microsoft.com/france/visual-studio/bonapp/hub-emission.aspx?Uuid=e804d5a6-d3cb-4886-95a6-2fc6a34b4fe5

 


Share/Save/Bookmark