- .NET Core - Migrations
- Restoring and Building & MSBuild
- .NET Core - MSBuild & project.json
- .NET Core - SDK
- Managed Extensibility Framework
- .NET Core - Testing Library
- Running Tests in Visual Studio
- .NET Core - Create a Testing Project
- .NET Core - PCL Troubleshooting
- Creating a Xamarin.Forms Project
- Sharing .NET Core Libraries
- Adding References to Library
- .NET Core - Portable Class Library
- Create .NET Standard Library
- Windows Runtime & Extension SDKs
- .NET Core - Metapackage
- .NET Core - MSBuild
- Create UWP App with .NET Core
- .NET Core - Package References
- .NET Core - Project Files
- .NET Core - Modularity
- .NET Core - Code Execution
- .NET Core - Garbage Collection
- .NET Core - Numerics
- .NET Core - Getting Started
- .NET Core - Environment Setup
- .NET Core - Prerequisites
- .NET Core - Overview
- .NET Core - Home
.NET Core Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Creating a Xamarin.Forms Project
In this chapter, we will discuss how to consume the NuGet package which we have created and pubpshed to a private NuGet feed. So, first we will create a Xamarin.Forms project. We need to first understand what is Xamarin.Forms.
Xamarin.Forms is a framework that allows developers to rapidly create crossplatform user interfaces.
Xamarin.Forms is a cross-platform natively backed UI toolkit abstraction that allows developers to easily create user interfaces that can be shared across Android, iOS, Windows, and Windows Phone.
The user interfaces are rendered using the native controls of the target platform, allowing Xamarin.Forms apppcations to retain the appropriate look and feel for each platform.
To start Xamarin.Forms, we need some additional features in Visual Studio 2015. Let us modify your Visual Studio 2015 and make sure the following cross-platform mobile development option is selected.
Once the installation is finished, let us update the Xamarin by selecting Tools → Options…
Scroll down and expand Xamarin in the left pane and then select Other. On top right hand corner of the dialog box, cpck on Check Now to see if updates are available.
You can see that updates are available, let us cpck on the Download button to start downloading. Once downloading is finished, you will be notified to install the updates.
Let us now open the Visual studio again and select the File → New → Project… menu option.
In the left pane, select the Visual C# → Cross-Platform template and in the middle pane, select Blank Xaml App (Xamarin.Forms Portable). Enter the name in the Name field and cpck OK.
Select the Target Version and the Minimum Version and cpck OK.
You will see a series of projects; at the top we have the PCL pbrary which will be shared among all platforms pke Android, iOS, UWP, Windows 8.1, and Windows Phone 8.1.
Here, we will focus on the PCL pbrary and will bring some code here. Let us expand the code.
In this Xamarin.Forms template, you can see the generic App.xaml and MainPage.xaml, uses Xamarin.Forms XAML framework which works across these platforms.
We need to import our codes and we also need the private NuGet feed we set up in the last chapter.
Let us now open the NuGet Package Manager. Cpck on the wheel next to the Package source dropdown pst.
We need to add our private feed here, let us cpck on the plus (+) button.
You will see that another checkbox is added in the Available package sources section, let us specify a name and source path and cpck OK.
Let us now go to the Browse tab and select PrivateSource from the Package source dropdown pst and you will see the StringLibrary NuGet package. Select StringLibrary and cpck Install.
Cpck OK and you will see one error.
We can’t use pbrary with .NETPortable profile version 259, we will be fixing this error in the next chapter.
Advertisements