title: C# WPF two different DataContext in One Control while using MVVM and the secound property is every time the same
body: <p>First the code:</p>
  
  <pre><code>&lt;ListView ItemsSource="{Binding DataTransferModel.Output}" Background="Transparent" Margin="0" VerticalContentAlignment="Top" AlternationCount="2" Name="lvOutput" ScrollViewer.VerticalScrollBarVisibility="Auto" Grid.Row="2"&gt;
      &lt;ListView.ItemTemplate&gt;
          &lt;DataTemplate&gt;
              &lt;StackPanel Orientation="Horizontal" Margin="0,1"&gt;
                  &lt;UserControls:OutputTextBox Text="{Binding Data, Mode=OneWay}" 
                                              IsReadOnly="True" 
                                              Grid.Row="2" 
                                              TextWrapping="WrapWithOverflow" 
                                              SelectedValue="{Binding Path=DataContext.SelectedOutput, 
                                                              Mode=TwoWay, 
                                                              UpdateSourceTrigger=PropertyChanged, 
                                                              RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Grid}}
                                                              }" 
                                              /&gt;
              &lt;/StackPanel&gt;
          &lt;/DataTemplate&gt;
      &lt;/ListView.ItemTemplate&gt;
  &lt;/ListView&gt;
  </code></pre>
  
  <p>And the problem is that the property <code>Data</code> on the OutputTextBox control comes from the list, but the property <code>SelectedOutput</code> should come from the main DataContext the ViewModel. And the property <code>SelectedOutput</code> should be the same for every entry in the list. But currently it dosn't work. :(</p>