FrameLayout within a DrawerLayout
<p>I would like to wrap into a DrawerLayout a FrameLayout (to replace it on demand with other FrameLayouts at runtime). The Code below is from the GitHub project over <a href="https://github.com/PumpingCode/Xamarin-NavigationDrawerDemo" rel="nofollow noreferrer">here</a>.</p>

<p>But If I add a FrameLayout in the LinearLayout below the widget.Toolbar, I receive following exception</p>

<pre><code>Unhandled Exception:
System.InvalidCastException: Unable to convert instance of type 'Android.Widget.FrameLayout' to type 'Android.Support.Design.Widget.NavigationView'.
</code></pre>

<p>Without the FrameLayout it works perfectly. Where should I place the FrameLayout to achieve my goal?</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:id="@+id/drawer_layout"
    android:fitsSystemWindows="true"&gt;
  &lt;LinearLayout
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical"&gt;
    &lt;android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:minHeight="?attr/actionBarSize"
        android:background="?attr/colorPrimary"
        android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
        app:popupTheme="@style/ThemeOverlay.AppCompat.Light" /&gt;

    &lt;FrameLayout
           android:id="@+id/content_frame"
           android:layout_width="match_parent"
           android:layout_height="match_parent" /&gt;    

  &lt;/LinearLayout&gt;

  &lt;android.support.design.widget.NavigationView
      android:layout_width="wrap_content"
      android:layout_height="match_parent"
      android:layout_gravity="start"
      android:id="@+id/nav_view"
      app:menu="@menu/navmenu"
      app:headerLayout="@menu/header" /&gt;
&lt;/android.support.v4.widget.DrawerLayout&gt;
</code></pre>

<p>The MainAcitivty.cs</p>

<pre><code>    drawerLayout = FindViewById&lt;DrawerLayout&gt;(Resource.Id.drawer_layout);

    // Init toolbar
    var toolbar = FindViewById&lt;Android.Support.V7.Widget.Toolbar&gt;(Resource.Id.toolbar);
    SetSupportActionBar(toolbar);

    // Attach item selected handler to navigation view
    var navigationView = FindViewById&lt;NavigationView&gt;(Resource.Id.nav_view);
    navigationView.NavigationItemSelected += NavigationView_NavigationItemSelected;

    // Create ActionBarDrawerToggle button and add it to the toolbar
    var drawerToggle = new ActionBarDrawerToggle(this, drawerLayout, toolbar, Resource.String.open_drawer, Resource.String.close_drawer);
    drawerLayout.AddDrawerListener(drawerToggle);
    drawerToggle.SyncState();
</code></pre>