Q:

Error when declaring Button Click - Android C# Xamarin

I am trying to declare an ImageButton for a Click Event, but an Error is given.
What would be giving this error?
(Error is occuring on btnSettingsBack.Click += btnSettingsBack_Click;
MainActivity Code (OnCreate):
    ImageButton btnSettings = FindViewById<ImageButton>(Resource.Id.btnSettings);
    ImageButton btnSettingsBack = FindViewById<ImageButton>(Resource.Id.btnSettingsBack);
    btnAdd = FindViewById<Button>(Resource.Id.btnAdd);
    lvNotes = FindViewById<ListView>(Resource.Id.lvNotes);
   dbHelper = new DbHelper(this);

    //Load Data
    LoadNoteList();

    btnAdd.Click += BtnAdd_Click;

    btnSettings.Click += BtnSettings_Click;

    btnSettingsBack.Click += BtnSettingsBack_Click;

}

Error:

UPDATE 1: Settings.axml Layout Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#fff"
    android:minWidth="25px"
    android:minHeight="25px">
    <LinearLayout
        android:orientation="horizontal"
        android:layout_width="match_parent"
        android:layout_height="80dp"
        android:id="@+id/linearLayout1"
        android:padding="20px"
        android:background="#22A7F0">
        <ImageButton
            android:src="@drawable/menu_back"
            android:background="#22A7F0"
            android:layout_weight="0.6"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_margin="30px"
            android:id="@+id/btnSettingsBack"
            android:layout_gravity="center" />

UPDATE 2: OnCreate Code
protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);
            ActionBar.Hide();

            ImageButton btnSettings = FindViewById<ImageButton>(Resource.Id.btnSettings);
            ImageButton btnSettingsBack = FindViewById<ImageButton>(Resource.Id.btnSettingsBack);
            btnAdd = FindViewById<Button>(Resource.Id.btnAdd);
            lvNotes = FindViewById<ListView>(Resource.Id.lvNotes);
           dbHelper = new DbHelper(this);

            //Load Data
            LoadNoteList();

            btnAdd.Click += BtnAdd_Click;

            btnSettings.Click += BtnSettings_Click;

            btnSettingsBack.Click += BtnSettingsBack_Click;

        }

A:

You are setting as the contentView of your activity a file called Main.axml
SetContentView(Resource.Layout.Main);

But you have the ImageButton defined in another file called Settings.axml
This is why is btnSettingsBack is null and hence the error.
Each one of these Controls must exists in the Layout you set as the ContentView of your page. If any of those are not present you will have a NullReferenceException when trying to access it.
ImageButton btnSettings = FindViewById<ImageButton>(Resource.Id.btnSettings);
ImageButton btnSettingsBack = FindViewById<ImageButton>(Resource.Id.btnSettingsBack);
btnAdd = FindViewById<Button>(Resource.Id.btnAdd);

Think of FindViewById as a way of querying the Layout you provided to your Activity using the ResourceId you are passing. If the Id is not present this method will not complaint but it will return Null so it's our job making sure every Id you pass is part of the layout you are setting.

