title: Setting multiple Datacontext
body: <p>I am trying to find out how to set correctly multiple <code>DataContexts</code> in XAML page. I have a basic collection that I create in code behind and set <code>ItemSource</code> Binding og <code>AutoCompleteBox</code> to it. At the same time, I have another <code>datacontext</code> to set <code>labelsDataSource</code> inside the grid. If I set this datacontext, the AutoCompleteBox’s itemsSource binding is lost. <code>AutoCompleteBox</code> is inside that grid. I do assign <code>DataContext</code> directly to the objetc this way:</p>
  
  <pre><code>MyAutoCompleteBox.DataContext = this;
  </code></pre>
  
  <p>I am wondering if there is a better way to do it? 
  Thank you in advance for the help!</p>
  
  <p>Setting AutoComplete Box:</p>
  
  <pre><code>&lt;sdk:AutoCompleteBox x:Name="MyAutoCompleteBox" IsTextCompletionEnabled="True" ItemsSource="{Binding Items}" /&gt;
  </code></pre>
  
  <p>Code Behind:</p>
  
  <pre><code>public IList&lt;string&gt; Items
      {
          get;
          private set;
      }
  
      public Basic_ChildWindow()
      {
          InitializeComponent();
          Items = new List&lt;string&gt;();
          Items.Add(@"One");
          Items.Add(@"Two");
          Items.Add(@"Three");
  
          DataContext = this;
      }
  </code></pre>
  
  <p>Another datacontext in the same XAML page, AutoCompleteBox is inside that grid:</p>
  
  <pre><code>&lt;Grid x:Name="grdBasic_ChildWindow_Right" Style="{StaticResource GridStyle}" DataContext="{Binding Source={StaticResource LabelsDataSource}}"&gt;
  </code></pre>