Introduction To Universal Windows Platform And Creating A Basic Application

What is Universal Windows Platform (UWP)?

UWP is a part of Windows 10 and Windows 10 Mobile. It is a platform, where homogeneous Application architecture is created by Microsoft, which does not run on earlier versions of Windows . An extension to the Windows runtime platform was first introduced in Windows Server 2012 and Windows 8 PC. Today UWP apps can run on different devices which  run on Windows 10 OS such as Desktop, Phone, Surface etc.

1
Source - https://msdn.microsoft.com/en-us/windows/uwp/get-started/universal-application-platform-guide
 
Universal Windows Platform (UWP) app provides a UX on images with different screen sizes and input methods. It supports Windows Application development, using C++, C#, VB.NET or XAML.

UWP App Feature 
  1. Pixels and Scaling  
    UWP apps can automatically adjust the size of controls, fonts and other elements. For example,  from a few inches away a 24 PX font Surface Hub from 10 feet is applicable to the user as a 24 PX font on a 5 inch phone.
    2
    Source - https://msdn.microsoft.com/en-us/windows/uwp/layout/design-and-ui-intro

  2. Styles

    A set of styles that automatically gives your app a light or dark theme (as your choice) and can incorporate the user's accent color preference.
Now, let’s learn how to work on UWP with XAML in Visual Studio 2015.

3
Source - https://msdn.microsoft.com/en-us/windows/uwp/layout/design-and-ui-intro

Requirements

Here is the list of software, which is as follows.
  • Windows 10
  • Visual Studio 2015 (If you don't have Visual Studio 2015 you can download first).
After installing these software, you need to enable your Windows 10 device. You can only use XAML designer, if your development platform is Windows 10.

Create a “Guudmorning” world with XAML.

Launch Visual Studio 2015.

Step 1

In this step, select File menu and select New followed by Project.

4

Step 2

Open Installed > Templates > Visual C# > Windows and then choose Universal to see the list of UWP project templates. Select the Blank app (Universal Windows). Give the name, select location and click OK.
 
5
 
The target version/minimum version dialog appears. The default settings are fine, so select OK to create the project.
 
6

Step 3

In this step, this file is displayed in Solution Explorer on the right pane. You can choose Solution Explorer tab instead of the Properties tab to see your files. Double click on MainPage.xaml to open in the Design view.

7

Step 4

In this step, click on the vertical Toolbox tab on the left pane to select the Button control and you are shown the MainPage.xaml box.
 
8
 
Step 5

Select the content name “guudmorning” and Text to 24 px.

9
 
Afterwards, your XAML code gets automatically generated in the box.


Step 6

Now, select “Local Machine” option to run the program.


Step 7

Now, your program will be run and is shown in your Windows.
 
After clicking on guudmorning, the screen appears, as shown below.
 


I hope, you enjoyed this article. Follow C# Corner to learn more new and amazing things about Windows 10.

Thanks for reading this article.

Up Next
    Ebook Download
    View all
    Learn
    View all