Session: Code Sharing between Windows Phone/Store Apps

Today, I got opportunity to interact with developers at Microsoft Innovation Center Karachi to demonstrate code sharing between Windows Phone and Windows Store apps.

Slide deck can also be download from OneDrive

Code has been published to github code repository

Sharing Code between Windows Store/Phone Apps using MVVM and PCL

I recently published an article on about how developers can share their code base across Windows Phone and Windows Store apps using Model-View-ViewModel (MVVM) pattern and Portable Class Libraries (PCL).

If you are windows developer with experience of implementing MVVM or want to implement MVVM, I would request you to read the article and I would be happy to listen to your feedback.

Sharing Code Between Windows Phone and Windows Store Apps using MVVM and PCL

Excerpt from article:

As the business wants to expand its reach to different form factors and devices, a large number of developers build native apps across different platforms. One particular scenario is when developers wants to target Windows Phone and Windows Store platform. Unlike Android, developers have to create different projects inside Visual Studio for Windows Store and Windows Phone apps.

This article explains how developers can utilize the Model-View-ViewModel (MVVM) and .NET portable class libraries to create a common shared business logic across both platforms. We would not be able to cover MVVM introduction in this article, so I expect readers would already know about it, if you don’t know what MVVM is, I would recommend to read some intro articles first on MVVM before continuing further.

The App

For the sake of simplicity and learning, we are going to create a simple contact form app on both phone and tablet, which would look something like sketch below:

The Design

The design goal here is to move all the core business model, view-models, helpers and repositories in a separate portable class library which can be referenced by UI/View projects. The connection of view with view-models would be through data binding and commands etc.

One point worth mentioning here is that helpers and repositories from PCL would further communicate with external portable libraries like e.g. Http Client to perform network operation across both platform using same PCL dll. Now in real world you may not be able to achieve this 100% but it would work in many scenarios.


So let’s start coding! we would create a simple yet naive approach of achieving the design above. Continue reading…

Where is Windows 8 Store App Suspend Resume Shutdown Option in Visual Studio 2012 Ultimate?

If you have been developing Windows 8 apps using Visual Studio 2012 Express and recently started working on Visual Studio 2012 Ultimate, it might take you few minutes to figure out where is “Suspend”, “Resume”, and “Suspend and Shutdown” option during debugging. 

Because you may know that Visual Studio is a huge product and each express version is tailored as per its usage. So default toolbar of VS ultimate does not include this option enabled.
So all you have to do is to select “Debug Location” under View -> Toolbar -> Debug Location. 

That’s it. Now you can see the “Suspend” etc. option in toolbar. 

Just thought to share this small thing as it took my couple of minutes to figure this out.