Step 1
If not already, follow Setup and Start on how to Install and get Started with Visual Studio 2017 or in Windows 10 choose Start, and then from the Start Menu locate and select Visual Studio 2017.
Step 2
Once Visual Studio Community 2017 has started, from the Menu choose File, then New then Project…
Step 3
From New Project choose Visual C# from Installed, Templates then choose Cross Platform App (Xamarin) and then type in a Name and select a Location and then select Ok to create the Project
Step 4
Then in New Cross Platform App you need to select the Blank App Template then from UI Technology select Xamarin.Forms and in Code Sharing Strategy select Shared Project and then select Ok to continue
Step 5
The Xamarin Mac Agent will be displayed allowing connection to an Apple Mac but this can be dismissed with Close if running solely on Windows 10
Step 6
Then in New Universal Windows Project you need to select the Target Version to be Windows 10 Creators Update (10.0; Build 15063) and the Minimum Version to Windows 10 Creators Update (10.0; Build 15063) and then select Ok
Step 7
In the Solution Explorer select MainPage.xaml from the Shared Project
Step 8
From the Menu choose View and then Open
Step 9
The XAML View will be displayed, and in this remove the Label then between the ContentPage and /ContentPage elements, enter the following XAML:
<Button HorizontalOptions="Center" VerticalOptions="Center" Text="Display" Clicked="Button_Click"/>
It should appear as such:
Step 10
In the Solution Explorer select the Expand arrow next to MainPage.xaml to open MainPage.cs, then select this from the Shared Project
Step 11
From the Menu choose View and then Open
Step 12
Once in the Code View, below the public MainPage() { … } the following Code should be entered:
public void Button_Click(object sender, EventArgs e) { DisplayAlert("Hello World", "Hello World", "Ok"); }
It should then appear as such:
Step 13
That completes the application, so from the Menu choose Build and then Build Solution
Step 14
Then from the Menu choose Debug then Start Debugging to run the Application in the Android Emulator
Step 15
Once started the Application should then appear in the Android Emulator
Step 16
After the Application has started running you can then select Display to show a Dialog with the text Hello World and can be closed when you select OK
Step 17
To Exit the Application select Stop in Visual Studio
Step 18
Another option is to run as a Universal Windows Application. From Solution Explorer select the Project ending with .UWP (Universal Windows), then from the Menu choose Project then Set as StartUp Project
Step 19
Then again from the Menu choose Build and then select the Deploy option ending with .UWP
Step 20
Then once again from the Menu choose Debug then Start Debugging to run the Application in Windows 10
Step 21
Once started the Application should then appear
Step 22
After the Application has started running you can then select Display to show a Dialog with the text Hello World and can be closed when you select OK
Step 23
To Exit the Application select Stop in Visual Studio
Step 24
Also if you have Mac with the Xamarin tools installed and have enabled and connected to the Xamarin Mac Agent. From Solution Explorer select the Project ending with .iOS, then from the Menu choose Project then Set as StartUp Project
Step 25
Then once again from the Menu choose Debug then Start Debugging to run the Application for iOS
Step 26
Once started the Application should then appear
Step 27
After the Application has started running you can then select Display to show a Dialog with the text Hello World and can be closed when you select OK
Step 28
To Exit the Application select Stop in Visual Studio
Thanks for Julia Boichentsova for helping with iOS screenshots