Getting Started Windows Universal App

 Universal Windows Platform (UWP) allows you to build apps which works on all devices that runs on windows 10.

 Getting Started

1.    First of all, install visual studio 2015 Enterprise.

2     Once visual studio started Select File, Then New, Then Project from Menu.


Image 1.

S3.  Select Visual C# from installed templates, then select Windows, Select Universal then select Blank App.


Image 2.

4.   Now project created.


Image 3.

Now open MainPage.xaml and write hello world code.

<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" Margin="0,0,-772,0">

<StackPanel x:Name="contentPanel" Margin="8,32,55,46">

<TextBlock Text="Hello, world!" Margin="0,0,0,40"/>

<TextBlock Text="What's your name?"/>

<StackPanel x:Name="inputPanel" Orientation="Horizontal" Margin="0,20,0,20">

<TextBox x:Name="nameInput" Width="280" HorizontalAlignment="Left"/>

<Button x:Name="btn" Content="Say &quot;Hello&quot;" Click="btn_Click" Height="39" Width="154"/>

<Button x:Name="button" Content="Open Popup" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Height="36" Width="145" Click="button_Click"/>

</StackPanel>

<TextBlock x:Name="txtOutput"/>

</StackPanel>

</Grid>

private void btn_Click(object sender, RoutedEventArgs e)
{
  txtOutput.Text = "Hello " + nameInput.Text;
}

private async void button_Click(object sender, RoutedEventArgs e)
{
  await new Windows.UI.Popups.MessageDialog("Hello World").ShowAsync();
}


Image 4.


Ebook Download
View all
Learn
View all