title: WPF DataContext Grid Binding
body: <p>I have the following in my XAML</p>
  
  <pre><code>&lt;UserControl.Resources&gt;
      &lt;vm:StaffViewModel x:Key="StaffViewModel" /&gt;
      &lt;CollectionViewSource x:Key="StaffViewSource" Source="{Binding StaffMembers}" /&gt;
  &lt;/UserControl.Resources&gt;
  
      &lt;Grid x:Name="StaffGrid" DataContext="{StaticResource StaffViewSource}"&gt;
          &lt;Grid.ColumnDefinitions&gt;
              &lt;ColumnDefinition Width="Auto"/&gt;
              &lt;ColumnDefinition Width="Auto"/&gt;
          &lt;/Grid.ColumnDefinitions&gt;
          &lt;Grid.RowDefinitions&gt;
              &lt;RowDefinition Height="Auto"/&gt;
              &lt;RowDefinition Height="Auto"/&gt;
          &lt;/Grid.RowDefinitions&gt;
  
          &lt;Label Content="FirstName:" Grid.Column="0" Grid.Row="0"/&gt;
          &lt;TextBox Grid.Column="1" Grid.Row="0" Text="{Binding FirstName, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true}" /&gt;
          &lt;Label Content="Surname:" Grid.Row="1" VerticalAlignment="Center"/&gt;
          &lt;TextBox Grid.Column="1" Grid.Row="1" Text="{Binding Surname, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true}"/&gt;
      &lt;/Grid&gt;
  </code></pre>
  
  <p>In my ViewModel I have an Observable Collection of Objects that I turn into a CollectionView</p>
  
  <pre><code>    private ObservableCollection&lt;Staff&gt; _staffMembers = null;
      private ICollectionView _staffMembersView = null;
  
      public ICollectionView StaffMembers
      {
          get { return _staffMembersView; }
      }
  
  
      public StaffView()
      {
          InitializeComponent();
  
          _staffMembers = GetStaff();
          _staffMembersView = CollectionViewSource.GetDefaultView(_staffMembers);
  
      }
  </code></pre>
  
  <p>but I don't get any Binding appearing in my textboxes</p>
  
  <p>What am I missing?</p>
  
  <p>I have done a similar thing in the past using EntityFramework and Datasets.  This is what I defined on that occasion:-</p>
  
  <pre><code>&lt;UserControl.Resources&gt;
      &lt;local:CantileverDataSet x:Key="CantileverDataSet"/&gt;
      &lt;CollectionViewSource x:Key="CabinetsViewSource" Source="{Binding Cabinets, Source={StaticResource CantileverDataSet}}"/&gt;
  &lt;/UserControl.Resources&gt;
  &lt;Grid DataContext="{StaticResource CabinetsViewSource}"&gt;
        &lt;!-- Individual Fields as textboxes here --&gt;
  &lt;/Grid&gt;
  </code></pre>