Xamarin Project Architecture


Today we will be discussing the architecture of a Xamarin Project in Visual Studio on Mac.
By default, a Xamarin Project consists of three Projects:
  1. Xamarin main Project (Where we will be sharing our Business logic and UI (User interface) throughout the application.
  2. Xamarin Android Project (We can do platform-specific changes if required natively, and we can also access native features).
  3. Xamarin iOS Project (The same is the case here).
Xamarin Project Architecture 
If we check out the main project, we can see a lot of files and folders here.
The first one is the Dependencies folder, which consists of two extra folders (Nuget and SDK). The NuGet Package consists of all the NuGet packages which are download through the NuGet package manager(third party services manager) for our project. In the pic, we see currently that we have two Nuget packages installed (Xamarin Essentials and Xamarin forms). Next, if we see the SDK (Software Development kit) folder here, we have installed SDKs in our Project.
Xamarin Project Architecture
Next, we have an App.xaml page and behind it we also have an App.xaml.cs page. 
First App.xaml page consist of our Application Resources which are globally accessible throughout the application life cycle. Here we can define our Custom resources like Styles, colors and font-family, etc. These resources are accessible throughout the application. The code is here is in XML language.
Next, if we see the App.xaml.cs page, it consists of C# Code. That which we can do through App.xaml we can also do with the App.xaml.cs page.
Here, the most important portion is the Page setting, where we can set the Main Page of our application as seen in the picture. 
Xamarin Project Architecture 
Xamarin Project Architecture 
Similarly, if we see the Main Page, it consists of two portions one is Mainpage.xaml and other is MainPage.xaml.cs, these are two Page normal pages of presentation view.
It can also be created through XAML language or C#.
Xamarin Project Architecture 
That's it for now, we will be covering the remaining platform-specific project structures.
Thank you, happy coding!