Introduction
Xamarin is a platform to develop cross-platform and multi-platform apps (for example, Windows phone, Android, iOS). In Xamarin platform, the code sharing concept is used. In Xamarin Studio, Visual Studio is also available.
Prerequisites
- Visual Studio 2015 Update 3.
The steps, given below, are required to be followed in order to Draw Polygon Graphics in the Xamarin Android app, using Visual Studio 2015.
Step 1
Click File--> select New--> select Project. The project needs to be clicked after opening all the types of projects in Visual Studio, or click (Ctrl+Shift+N).

Step 2
After opening the New Project, select Installed-->Templates-->Visual C#-->Android-->choose the Blank app (Android).
Now, give your Android app a name (Ex:sample) and give the path of your project. Afterwards, click OK.

Step 3
Next, go to the Solution Explorer and select Resource-->Layout-->double click to open main.axml page. There, you can select either Source mode to write the code or Design mode to design your app.

Step 4
After opening it, the main.axml file will open the main page designer. In this page, you can design this page.

Step 5
In this step, add one Class file called FilledPolygon.cs.
Go to Solution Explorer-->Resource-->Right Click-->Add-->New Item (Ctrl+shift+A).

Step 6
Now, select the Class file and give name FilledPolygon.cs, and click Add.

Step 7
After creating the FilledPolygon.cs file, add the following Namespace inside the namespace and create one subclass called View.
FilledPolygon.cs
Now, give your Android app a name (Ex:sample) and give the path of your project. Afterwards, click OK.

Step 3
Next, go to the Solution Explorer and select Resource-->Layout-->double click to open main.axml page. There, you can select either Source mode to write the code or Design mode to design your app.

Step 4
After opening it, the main.axml file will open the main page designer. In this page, you can design this page.

Step 5
In this step, add one Class file called FilledPolygon.cs.
Go to Solution Explorer-->Resource-->Right Click-->Add-->New Item (Ctrl+shift+A).

Step 6
Now, select the Class file and give name FilledPolygon.cs, and click Add.

Step 7
After creating the FilledPolygon.cs file, add the following Namespace inside the namespace and create one subclass called View.
FilledPolygon.cs
- namespace polygon {
- using Android.Content;
- using Android.Graphics;
- using Android.Views;
- class FilledPolygon: View {}
- }






Join the conversation! Your thoughts help the community grow.