Step 1

Download Visual Studio Community 2015 and install it onto your computer, if it’s already downloaded and installed select Launch to start Visual Studio Community 2015 or if it has already been downloaded and installed then start the application you may also need to Enable your device for development.

Step 2

Once Visual Studio Community 2015 has started select File, then New, then Project… from the Menu.

Step 3

From the New Project window select Visual C# from Installed, Templates then select Blank App (Windows Universal) from the list, then type in a Name and select a Location to save to before selecting Ok to create the Project.

Step 4

Once done select from the Menu, Project, then Add New Item…





Step 5

From the Add New Item window select Visual C# from Installed and select Code then select Code File from the list, then type in the Name as Library.cs before selecting Add to add the file to the Project

Step 6

Once in the Code View for Library.cs the following should be entered:

using System; using System.Collections.Generic; using Windows.System; using Windows.UI.Xaml.Controls; public class Setting { public string Name { get; set; } public string Icon { get; set; } public string Value { get; set; } } public class Library { public List<Setting> Settings { get { return new List<Setting>() { new Setting() { Name = "Display", Icon = "\uE7F8", Value = "display" }, new Setting() { Name = "Notifications", Icon = "\uE91C", Value = "notifications" }, new Setting() { Name = "Battery", Icon = "\uE8BE", Value = "batterysaver" }, new Setting() { Name = "Storage", Icon = "\uE8B7", Value = "storagesense" }, new Setting() { Name = "Data", Icon = "\uE774", Value = "datausage" }, new Setting() { Name = "Personalisation", Icon = "\uE771", Value = "personalization" }, new Setting() { Name = "Privacy", Icon = "\uE1F6", Value = "privacy" }, new Setting() { Name = "Developers", Icon = "\uEC7A", Value = "developers" } }; } } public static async void Launch(GridView grid) { string value = ((Setting)(grid.SelectedItem)).Value; await Launcher.LaunchUriAsync(new Uri("ms-settings:" + value)); } }

It should then appear as such:

Step 7

From the Solution Explorer select App.xaml





Step 8

Select from the Menu, View then Designer

Step 9

The XAML View will be displayed and in this above </Application> enter the following XAML:

<Application.Resources> <DataTemplate x:Key="Desktop"> <Grid Width="200" Height="200"> <StackPanel VerticalAlignment="Center"> <Viewbox Height="50" Width="50" HorizontalAlignment="Center"> <TextBlock Text="{Binding Icon}" FontFamily="Segoe MDL2 Assets" Foreground="{ThemeResource SystemControlHighlightAccentBrush}"/> </Viewbox> <TextBlock Text="{Binding Name}" Margin="10" HorizontalAlignment="Center" Style="{StaticResource FlyoutPickerTitleTextBlockStyle}"/> </StackPanel> </Grid> </DataTemplate> <ItemsPanelTemplate x:Key="DesktopItems"> <ItemsWrapGrid Orientation="Horizontal" MaximumRowsOrColumns="4"/> </ItemsPanelTemplate> <DataTemplate x:Key="Mobile"> <Grid Width="200"> <StackPanel Orientation="Horizontal"> <Viewbox Height="25" Width="25" HorizontalAlignment="Left"> <TextBlock Text="{Binding Icon}" FontFamily="Segoe MDL2 Assets" Foreground="{ThemeResource SystemControlHighlightAccentBrush}"/> </Viewbox> <TextBlock Text="{Binding Name}" Margin="10" HorizontalAlignment="Left" Style="{StaticResource BodyTextBlockStyle}"/> </StackPanel> </Grid> </DataTemplate> <ItemsPanelTemplate x:Key="MobileItems"> <ItemsWrapGrid Orientation="Horizontal" MaximumRowsOrColumns="1"/> </ItemsPanelTemplate> </Application.Resources>

It should appear as such:

Step 10

Once done select from the Menu, Project, then Add New Item…





Step 11

From the Add New Item window select Visual C# from Installed and select XAML then select Blank Page from the list, then type in the Name as SecondaryPage.xaml before selecting Add to add the file to the Project

Step 12

The Design View will be displayed along with the XAML View and in this below <Grid Background=”{ThemeResource ApplicationPageBackgroundThemeBrush}”> enter the following XAML:

<GridView Name="Display" HorizontalAlignment="Center" VerticalAlignment="Center" SelectionChanged="Display_SelectionChanged" ItemTemplate="{StaticResource Mobile}" ItemsPanel="{StaticResource MobileItems}" ItemsSource="{x:Bind Path=Library.Settings}"/>

It should appear as such:

Step 13

Select from the Menu, View then Code

Step 14

Once in the Code View below the public Page() { … } the following should be entered:

public Library Library = new Library(); private void Display_SelectionChanged(object sender, SelectionChangedEventArgs e) { Library.Launch(Display); }

It should then appear as such:





Step 15

From the Solution Explorer select App.xaml





Step 16

Select from the Menu, View then Code

Step 17

Once in the Code View in protected override void OnLaunched(LaunchActivatedEventArgs e) { … } the following should be entered above rootFrame.Navigate(typeof(MainPage), e.Arguments);:

if (Windows.System.Profile.AnalyticsInfo.VersionInfo.DeviceFamily.Contains("Mobile")) { rootFrame.Navigate(typeof(SecondaryPage), e.Arguments); Window.Current.Activate(); return; }

It should then appear as such:

Step 18

From the Solution Explorer select MainPage.xaml

Step 19

Select from the Menu, View then Designer

Step 20

The Design View will be displayed along with the XAML View and in this below <Grid Background=”{ThemeResource ApplicationPageBackgroundThemeBrush}”> enter the following XAML:

<GridView Name="Display" HorizontalAlignment="Center" VerticalAlignment="Center" SelectionChanged="Display_SelectionChanged" ItemTemplate="{StaticResource Desktop}" ItemsPanel="{StaticResource DesktopItems}" ItemsSource="{x:Bind Path=Library.Settings}"/>

It should appear as such:

Step 21

Select from the Menu, View then Code

Step 22

Once in the Code View below the public MainPage() { … } the following should be entered:

public Library Library = new Library(); private void Display_SelectionChanged(object sender, SelectionChangedEventArgs e) { Library.Launch(Display); }

It should then appear as such:

Step 23

That completes the Universal Windows Application so Save the Project then select the Debug and Simulator option to run the Application

Step 24

Once the Simulator has started the Application should then appear displaying the Desktop view of the Application

Step 25

To Exit the application select Stop Debugging in Visual Studio Community 2015





Step 26

Another option is to run as a Windows 10 Mobile application, select Debug and select Emulator 10.0.10586.0 WVGA 4 inch 512MB option to run the Application

Step 27

Once the Emulator has started the Application should then appear displaying the Mobile view of the Application





Step 28

To Exit the application select Stop Debugging in Visual Studio Community 2015