If you want to achieve that, you should add following nuget package firstly.
Xamarin.Android.Support.v7.Preference
Then create xml folder, Add the preferences.xml.

Here is code add preferences.xml for testing.
<PreferenceScreen
xmlns:app="http://schemas.android.com/apk/res-auto">
<SwitchPreferenceCompat
app:key="notifications"
app:title="Enable message notifications"/>
<Preference
app:key="feedback"
app:title="Send feedback"
app:summary="Report technical issues or suggest new features"/>
</PreferenceScreen>
Then create a class called MySettingsFragment.cs, PreferenceFragmentCompat comes from Android.Support.V7.Preferences, populator the preferences.xml by SetPreferencesFromResource method.
using Android.OS;
using Android.Runtime;
using Android.Support.V7.Preferences;
using Android.Views;
using Android.Widget;
namespace App32
{
public class MySettingsFragment : PreferenceFragmentCompat
{
public override void OnCreatePreferences(Bundle savedInstanceState, string rootKey)
{
SetPreferencesFromResource(Resource.Xml.preferences, rootKey);
}
}
}
In the end, we can add a FrameLayout in your layout.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/settings_container"/>
</RelativeLayout>
In the activity to use MySettingsFragment like Fragment's transaction.
public class MainActivity : AppCompatActivity
{
protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
Xamarin.Essentials.Platform.Init(this, savedInstanceState);
// Set our view from the "main" layout resource
SetContentView(Resource.Layout.activity_main);
SupportFragmentManager.BeginTransaction().Replace(Resource.Id.settings_container,new MySettingsFragment()).Commit();
}
}
}
Here is running sceenshot.
