title: An exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.ni.dll but was not handled in user code: in Xamarin Form
body: <p>I created the MasterDetailPage in Xamarin form but when i tried to run the app it gave me the above error. Below is the Xaml code for my MasterDetailPage</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;MasterDetailPage xmlns="http://xamarin.com/schemas/2014/forms"
           xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
           xmlns:pages="clr-namespace:App2;assembly=App2"
           x:Class="App2.ParentsMenuPage"&gt;
  &lt;MasterDetailPage.Master&gt;
  &lt;pages:ParentMasterPage x:Name="masterPage" /&gt;
  &lt;/MasterDetailPage.Master&gt;
  &lt;MasterDetailPage.Detail&gt;
  &lt;NavigationPage&gt;
    &lt;x:Arguments&gt;
      &lt;pages:ParentHomePage /&gt;
     &lt;/x:Arguments&gt;
    &lt;/NavigationPage&gt;
  &lt;/MasterDetailPage.Detail&gt;
  &lt;/MasterDetailPage&gt;
  
  
   The Xaml code for My Master Page is below
  
  
   &lt;?xml version="1.0" encoding="utf-8" ?&gt;
   &lt;ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
           xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
           x:Class="App2.ParentMasterPage" Padding="0,40,0,0"&gt;
  &lt;ContentPage.Content&gt;
  &lt;StackLayout VerticalOptions="FillAndExpand"&gt;
    &lt;ListView x:Name="listView" VerticalOptions="FillAndExpand" SeparatorVisibility="None"&gt;
      &lt;ListView.ItemTemplate&gt;
        &lt;DataTemplate&gt;
          &lt;ImageCell Text="{Binding Title}" ImageSource="{Binding IconSource}" /&gt;
        &lt;/DataTemplate&gt;
      &lt;/ListView.ItemTemplate&gt;
     &lt;/ListView&gt;
    &lt;/StackLayout&gt;
  &lt;/ContentPage.Content&gt;
  </code></pre>
  
  <p></p>
  
  <p>The code-behind for the master page is below</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  
  using Xamarin.Forms;
  
  namespace App2
  {
  public class ParentMasterItem
  {
      public string Title { get; set; }
      public string IconSource { get; set; }
      public Type TargetType { get; set; }
  }
  
  public partial class ParentMasterPage : ContentPage
  {
      public ListView ListView { get { return listView; } }
  
      public ParentMasterPage()
      {
          InitializeComponent();
  
          var masterPageItems = new List&lt;ParentMasterItem&gt;();
          masterPageItems.Add(new ParentMasterItem
          {
              Title = "Home",
              IconSource = "images/home-small.png",
              TargetType = typeof(ParentHomePage)
          });
          masterPageItems.Add(new ParentMasterItem
          {
              Title = "My Ward's",
              IconSource = "images/ward-small.png",
              TargetType = typeof(ParentWardsPage)
          });
          masterPageItems.Add(new ParentMasterItem
          {
              Title = "Chat",
              IconSource = "images/chat-small.png",
              TargetType = typeof(ParentChatPage)
          });
  
          listView.ItemsSource = masterPageItems;
         }
        }
      }
  </code></pre>
  
  <p>Then Detail Page</p>
  
  <pre><code> &lt;?xml version="1.0" encoding="utf-8" ?&gt;
   &lt;ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
           xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
           x:Class="App2.ParentHomePage"&gt;
  
   &lt;ContentPage.Content&gt;
     &lt;StackLayout&gt;
      &lt;StackLayout.Children&gt;
       &lt;Frame OutlineColor="Accent"&gt;
         &lt;Frame.Content&gt;
           &lt;StackLayout Orientation="Horizontal"&gt;
            &lt;StackLayout.Children&gt;
              &lt;Label Text="Home Page"
                     VerticalOptions="Center" /&gt;
            &lt;/StackLayout.Children&gt;
           &lt;/StackLayout&gt;
         &lt;/Frame.Content&gt;
       &lt;/Frame&gt;
  
    &lt;/StackLayout.Children&gt;
  &lt;/StackLayout&gt;
  &lt;/ContentPage.Content&gt;
  &lt;/ContentPage&gt;
  </code></pre>
  
  <p>Please can anyone help me figure out where the problem is</p>