title: Exception thrown: 'System.ArgumentNullException' in mscorlib.ni.dll
body: <p>I am new to c# and trying to implement INotifyPropertyChanged for my ObsorvableCollection Class</p>
  
  <p>But Its giving an error and Data doesn't got binded. Someone please help me in resolving this</p>
  
  <blockquote>
    <p>An exception of type System.ArgumentNullException occurred in
    mscorlib.ni.dll but was not handled in user code</p>
  
  <pre><code>Additional information: Value cannot be null.
  </code></pre>
  </blockquote>
  
  <p>Thanks in Advance.</p>
  
  <p>My Xaml code:</p>
  
  <pre><code>&lt;Page 
  x:Class="App2.MainPage"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:local="using:App2"
  xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  mc:Ignorable="d"&gt;
  
  &lt;Page.BottomAppBar&gt;
      &lt;CommandBar Background="Orange"&gt;
          &lt;AppBarButton Icon="Sort" Label="Sort"&gt;
              &lt;AppBarButton.Flyout&gt;
                  &lt;MenuFlyout&gt;
                      &lt;MenuFlyoutItem Text="By Upvotes" Click="FilterItem_Click" Tag="name"/&gt;
                      &lt;MenuFlyoutItem Text="By OpenForms" Click="FilterItem_Click" Tag="lname"/&gt;
                      &lt;MenuFlyoutItem Text="By Ideas" Click="FilterItem_Click" Tag="ideas"/&gt;
                  &lt;/MenuFlyout&gt;
              &lt;/AppBarButton.Flyout&gt;
          &lt;/AppBarButton&gt;
      &lt;/CommandBar&gt;
  &lt;/Page.BottomAppBar&gt;
  &lt;Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"&gt;
      &lt;ListView ItemsSource="{x:Bind Path=person}" Margin="105,130,95,70"&gt;
          &lt;ListView.ItemTemplate&gt;
              &lt;DataTemplate x:DataType="local:Person"&gt;
                  &lt;TextBlock Text="{x:Bind Name}"&gt;&lt;/TextBlock&gt;
              &lt;/DataTemplate&gt;
          &lt;/ListView.ItemTemplate&gt;
      &lt;/ListView&gt;
     &lt;/Grid&gt;
  &lt;/Page&gt;
  </code></pre>
  
  <p>My cs Code:</p>
  
  <pre><code>        using App2.WrittenLibraries;
          using System.Collections.Generic;
          using System.Collections.ObjectModel;
          using System.ComponentModel;
          using System.Linq;
          using System.Threading.Tasks;
          using Windows.UI.Xaml;
          using Windows.UI.Xaml.Controls;
  
          // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=402352&amp;clcid=0x409
  
          namespace App2
          {
              /// &lt;summary&gt;
              /// An empty page that can be used on its own or navigated to within a Frame.
              /// &lt;/summary&gt;
              /// 
              public class Person : INotifyPropertyChanged
              {
                  private string name;
                  public string Name
                  {
                      get { return name;  }
                      set
                      {
                          name = value;
                          OnPropertyChanged("Name");
                      }
                  }
  
                  private string lastname;
                  private string v1;
                  private string v2;
  
                  public string Lastname
                  {
                      get { return lastname; }
                      set
                      {
                          lastname = value;
                          OnPropertyChanged("Lastname");
                      }
                  }
  
                  public event PropertyChangedEventHandler PropertyChanged;
  
                  private void OnPropertyChanged(string propertyName)
                  {
                      if (propertyName != null)
                      {
  
                          PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
                      }
                  }
  
  
                  public Person(string v1, string v2)
                  {
                      this.v1 = v1;
                      this.v2 = v2;
                  }
              }
              public sealed partial class MainPage : Page
               {
                  public ObservableCollection&lt;Person&gt; person = new ObservableCollection&lt;Person&gt;();
  
                  public MainPage()
                  {
                      this.InitializeComponent();
  
                      person.Add(new Person("F1", "L1"));
                      person.Add(new Person("F2", "L2"));
                  }
  
  
                  private void FilterItem_Click(object sender, RoutedEventArgs e)
                  {
                      MenuFlyoutItem selectedItem = sender as MenuFlyoutItem;
  
                      if (selectedItem != null)
                      {
                          if (selectedItem.Tag.ToString() == "name")
                          {
                              Util.debugLog("FILTER BY NAME");
                              person = new ObservableCollection&lt;Person&gt;(person.OrderBy(i =&gt; i.Name));
  
                              //FilterByUpvotes()();
                          }
                          else if (selectedItem.Tag.ToString() == "lname")
                          {
                              Util.debugLog("FILTER BY L_NAME");
                              person = new ObservableCollection&lt;Person&gt;(person.OrderBy(i =&gt; i.Lastname));
                              //FilterByOpenForm();
                          }
                          else if (selectedItem.Tag.ToString() == "ideas")
                          {
                              Util.debugLog("FILTER BY IDEAS");
                              //person = new ObservableCollection&lt;Person&gt;(person.OrderBy(i =&gt; i));
  
                              //FilterByIdeas();
                          }
                      }
                  }
              }
          }
  </code></pre>