Skip to main content

Hello World in UWP


Creating a Hello World application in Windows 10 which will target Universal Windows Plateform (UWP).

Basic Requirements:
  •  Visual Studio 2015
  • Windows 10

1.      Launch Visual Studio and select New Project.


2.      Select Windows > Universal > Blank App. Click ok and there you have your first UWP application!
 

3. Open the MainPage.xaml File
 
4.  Add a Button and a TextBlock to your view through toolbar or by adding this XAML code in the Grid tag. Don’t forget to add Name attribute to them.

<Button Name="ClickMeButton" Content="Click Me" Margin="10,10,0,598" />
       
<TextBlock x:Name="MessageTextBlock"
                   HorizontalAlignment="Left"
                   Margin="10,150,0,0"
                   TextWrapping="Wrap"
                   Text=""
                   VerticalAlignment="Top"
                FontSize="48"/>
  


5.       Select the Button you made and click on Properties and then Click on Event Handler icon



6.       Double click in the text box labeled as Click


7.       Code behind file of MainPage will open up.


8.  Enter following code in ClickMeButton_Click function.

            MessageTextBlock.Text =
"Hello World";


9.  Click on Local Machine to run your project.
     

10.   Done!

Comments

Post a Comment

Popular posts from this blog

Setting up for Universal Windows Platform Development

Setting up in order to develop Universal Windows Platform(UWP) apps aka Universal Windows apps aka Windows 10 apps is pretty easy.   Basic Requirements [System Requirements]   1. Get Latest Windows Install or upgrade to latest version of Windows operating system. Windows 10 will work.  Links:   Windows 10 - Download Manual   Windows 10 - Home Page 2. Get Visual Studio To develop UWP apps install the latest Visual Studio or update your existing one. At the minimum, Visual Studio 2015 is a must. Don’t forget to select Universal Windows App Development Tools feature while carrying out Visual Studio installation/updation.   Links:   Visual Studio - All Latest Versions   Visual Studio 2015 - Community Version Getting Started [All Developer Tools for Windows 10]   3. Enable Developer Mode After installing Visual Studio you need to enable developer mode on your system. In Windows 10 follow these steps.   Go to Settings ...