title: DomainDataSource, binding and cursors
body: <p>Databinding in WPF/Silverlight revolves around dependency properties, <code>DataContext</code> objects and <code>DataSource</code> objects. As far as I can tell, dependency properties are the same thing as ambient properties and their significance to binding is basically that if you put a bunch of widgets in a container then you only need to specify a <code>DataContext</code> for the container.</p>
  
  <p>There are several parts to this question.</p>
  
  <ol>
  <li>What is the difference between <code>DataContext</code> and <code>DataSource</code>, and how do they relate?</li>
  <li>What manages cursors in WPF/Silverlight databinding? Is there a direct equivalence to the WinForms <code>CurrencyManager</code> and <code>BindingContext</code>?</li>
  <li>How do I go about manipulating a <code>Cursor</code> in WPF/Silverlight databinding? </li>
  </ol>
  
  <p><code>DataGrid</code> seems to have a <code>CurrentItem</code> property. If you bind a bunch of widgets to the various columns of a datasource and they share the same datacontext as the datagrid then interactively moving the selected row in the datagrid changes the row whose values are expressed in the widgets. Could someone <em>please</em> explain to me how it all fits together? Preferably with reference to SL4.</p>
  
  <p>When I do this:</p>
  
  <pre><code>private void buttonNew_Click(object sender, RoutedEventArgs e)
  {
    Guid newId = Guid.NewGuid();
    Employee emp = new Employee() { Id = newId, FirstName = "NOT SET", LastName = "NOT SET" };
    AtomDomainContext adc = employeeDomainDataSource.DomainContext as AtomDomainContext;
    DomainDataSourceView ddsv = grid1.DataContext as DomainDataSourceView;
  }
  </code></pre>
  
  <p>I get this compilation error:</p>
  
  <pre><code>The type 'System.ComponentModel.IPagedCollectionView' is defined in an assembly 
  that is not referenced. You must add a reference to assembly 'System.Windows.Data, 
  Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
  D:\Argent\Views\ManageEmployees.xaml.cs, 57, 7, Argent
  </code></pre>
  
  <p>which sounds easy to fix but when I attempt to add a reference to the Argent project the list of references is empty; presumably one is confined to those assemblies that Silverlight deploys to the target computer. So now what do I do?</p>