The Universal Windows Platform (UWP) framework allows developers to build applications for the Windows device family including PCs, tablets, smartphones, HoloLens, Xbox, IoT, and Surface.
What is a UWP app?
The apps developed using UWP are called Universal apps or UWP apps. Figure 1 depicts the reach of Universal apps.

Figure 1.
- A UWP app can target all or some selected devices. The Core APIs are shared on all devices in the Windows family. There are extension SDKs that provide specialized APIs for each device in the family.
- A UWP app is developed using Visual Studio 2015 or later versions.
- A UWP app is packaged and distributed using the .appx packaging format.
- A UWP app is distributed to all devices using a single Windows Store.
UWP App Characteristics
UWP apps are similar to iOS and Android apps, but run on the Windows operating system. Some of the key characteristics of UWP apps are:
- Live tiles
- Lock screen live updates
- Push notifications with real-time updates and alerts
- Background tasks execution
- Access to device resources and hardware such as storage, camera, microphone, Bluetooth, and messaging center.
- Voice and speech recognitions.
- Integration with other products and services such as maps, gps, and cognitive services.
- Integration with Windows security, settings, and cloud.
Language Choices for UWP Apps
UWP apps are the way to build applications for Windows 10 and later Windows operating systems that target Windows family devices as shown in Figure 1.
There are three language choices to build UWP apps depending on your expertise and needs.
- JavaScript and HTML
- C# (or VB.NET) and XAML
- C++ and DirectX/XAML
In this article, we will use C# and XAML to build our apps.
Prerequisites
This article is for software professionals who want to build Windows Universal apps for Windows 10 PCs, Tablets, Smartphones, IoT, Xbox, and Surface devices. For our applications, we will use Visual Studio 2017 (RC as of now) Community or other versions of Visual Studio 2017.
Prerequisites for this book are:
- Understanding of C# language and object oriented programming.
- XAML language basic programming concepts.
- Knowledge of Visual Studio 2015 or later IDE.
You may want to download the Visual Studio 2017 Community edition here: https://www.visualstudio.com/
Hello, UWP!
Let’s create a simple “Hello, UWP!” app.
Create a Project in Visual Studio
Open Visual Studio and select File >> New >> Project menu.
In New Project, you will see Installed Templates in the left side templates listing. On the left side, you have a choice to select a language - Visual Basic or Visual C# or Visual C++.
I selected Visual C# -> Windows Universal -> Blank App (Universal Windows).
In the center area, make sure you have .NET Framework 4.6.1 selected in the first drop down list and the Blank App (Universal Windows) selected as the project type template. This template is used to create a Blank UWP app. As you can see from the far right side, a blank project is used to create a single-page Windows app that has no predefined controls or layout.

Figure 2.
Now on the Name text box, type the name of your project. For my project, I named it HelloUWP. The Location text below lets you browse the folder where you would like to store your project files. You can even change the solution name, if you would like, by changing the Solution Name field. This field is important when you have multiple projects in a single solution. I kept my Solution Name default.
Now click the OK button.
In the next step, you may see a popup dialog that will ask you select a target version and minimum version of the Windows operating system.
Understanding Project and Files
Once you click the OK button, you will see that the default Visual Studio solution looks like Figure 3.

Figure 3.
As you can see from Figure 3, there are 3 major areas of Visual Studio – the Code Editor, Solution Explorer, and Properties window. This may look different based on your previous Visual Studio settings.
First, I want to focus on the Solution Explorer. Figure 4 is the expanded view of the Solution Explorer.

Figure 4.
The Solution Explorer is a TreeView-like control that lists all projects and project files of a Solution. By default you will see the following nodes - Properties, References, Assets, App.xaml, a TemporaryKey, MainWindow.xaml, Package.appxmanifest, and project.json.
The Properties node has a file called AssemblyInfo.cs that stores the general information about an assembly. In this case, it’s the current app.
The References folder lists all the references added to a project.
The Assets folder list all the assets available to this app. As you can see from Figure 4, seven .png files are added by default to the project which are used as default logos for the app.
The App.xaml file is an application file and stores application-related code.
The HelloUWP_ TemporaryKey.pfx is a default certificate of the app.
The MainWindow.xaml and the .cs class is the representation of the main user interface window of the app.
The Package.appxmanifest files defines the app package manifest.
I will discuss these files in more detail in my following articles. In this article, I will focus on the Main Page.
The Main Page
A UWP app consists of one default MainPage.xaml file. This is the default user interface the app users will see when an app launches. The MainPage.xaml is the main user interface of an app. This is the screen users see when they launch their app.
Double click on MainPage.xaml file in Solution Explorer. The page opens in the designer with the XAML view.

Figure 5.
As you can see from Figure 5 XAML, the MainPage is derived from the Page class. The XAML also shows there is a Grid element added to the interface automatically that works as a container for the child controls.
Now it’s time to add controls to MainPage.
There are two ways to add controls to a page at design time. Firstly, it can be done by simply dragging and dropping controls from the Toolbox to the page; and secondly, by typing the XAML code by hand.
Now, drag and drop a Button, a TextBox, and a TextBlock control from Toolbox to MainPage. After moving and placing controls around, the final MainPage looks like Figure 6.





Anu VPosted Feb 7, 2017, 11:16 PM
Nice article sir, Thanks for sharing...
Vishal PrajapatiPosted Feb 7, 2017, 10:35 PM
Thanks for sharing Mahesh Sir..
Joe WilsonPosted Feb 7, 2017, 1:46 PM
Thank you for sharing it.
Asfend YarPosted Feb 7, 2017, 11:44 AM
Oh Man Why wasting time on UWP and there're couple of articles and blogs for UWP are already present. Also this doesn't make sense that why you people are repeating the same thing . You need to start from that area where one people has finished his/her job just like Artificial Intelligence theory. Think about it .