title: Using multiple ObjectDataProviders with the same control
body: <p>I've just started to learn binding in WPF and am having some trouble with using multiple ObjectDataProviders with the same control.</p>
  
  <p>I have two ObjectDataProviders :</p>
  
  <ol>
  <li>Is used to get a list of customer locations from a database and is used to populate a TreeView and</li>
  <li>Takes a location as a parameter and returns all the customers from that location, populating a listView.</li>
  </ol>
  
  <p>I'd like to make it so that when I click on one of the TreeView items, that it would take the SelectedItem text as the parameter, use it to populate the listview.</p>
  
  <pre><code>    &lt;ObjectDataProvider 
          x:Key="getLocations" 
          ObjectType="{x:Type local:DataSetCreator}"
          MethodName="getLocations" 
          /&gt;
  
      &lt;ObjectDataProvider 
          x:Key="getCustomersFromLocation" 
          ObjectType="{x:Type local:DataSetCreator}"
          MethodName="getCustomersFromLocation"&gt;
          &lt;ObjectDataProvider.MethodParameters&gt;
              &lt;x:Static Member="System:String.Empty" /&gt;
          &lt;/ObjectDataProvider.MethodParameters&gt;
      &lt;/ObjectDataProvider&gt;
  
  
      &lt;TreeView HorizontalAlignment="Left" 
          Margin="12,12,0,12" 
          Name="treeView2" Width="186"      
          ItemsSource="{Binding Source={StaticResource getLocations}}" &gt;
  
          &lt;TreeView.ItemTemplate&gt;
              &lt;DataTemplate&gt;
                  &lt;TextBlock Text="{Binding Country}" /&gt;                    
              &lt;/DataTemplate&gt;
          &lt;/TreeView.ItemTemplate&gt;
      &lt;/TreeView&gt;
  
  
      &lt;ListView x:Name="lstCustomers"
              ItemsSource="{Binding Source={StaticResource getCustomersFromLocation}}" Margin="204,41,12,12"&gt;
          &lt;ListView.View&gt;
              &lt;GridView&gt;
                  &lt;GridViewColumn Header="CustomerID"
                          Width="200"
                          DisplayMemberBinding="{Binding Path=CustomerID}" /&gt;
                  &lt;GridViewColumn Header="Company Name"
                          Width="370"
                          DisplayMemberBinding="{Binding Path=CompanyName}" /&gt;
              &lt;/GridView&gt;
          &lt;/ListView.View&gt;
      &lt;/ListView&gt;
  </code></pre>
  
  <p>Is it possible to achieve this within the XAML, or do I need to use the code-behind?</p>