title: Overriding inherited Datacontext
body: <p>I am having problem overriding the datacontext inherited from a parent. I have on global DataContext set, after that the Hub section Binds to an list in that model, which then propagates to the Listivew. Now each listview item is bound to an object, that also being the DataContext of the item. But each listview item has flyout. Now the flyout inherits the item DataContext and that is fine, but  one element in the Flyout has to be bound to a element of the initial global model.</p>
  
  <p>So I currently have the following Page</p>
  
  <pre><code>&lt;Page
  x:Class="LocationSave.HubPage"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:local="using:LocationSave"
  Name="root"
  xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  xmlns:i="using:Microsoft.Xaml.Interactivity"
  xmlns:core="using:Microsoft.Xaml.Interactions.Core"
  DataContext="{Binding DefaultViewModel, RelativeSource={RelativeSource Self}}"
  xmlns:data="using:LocationSave.Data"
  mc:Ignorable="d" FontFamily="Global User Interface"&gt;
  
  &lt;Page.Resources&gt;
      &lt;ResourceDictionary&gt;
          &lt;Flyout  x:Name="Edit_Flyout"&gt;
              &lt;Border  DataContext="{Binding}" &gt;
                  &lt;StackPanel Orientation="Vertical" &gt; 
                      &lt;ListView
                               DataContext= "{Binding The Problem is here}"
                                ItemsSource="{Binding}"&gt;
                          &lt;ListView.ItemTemplate&gt;
                              &lt;DataTemplate&gt;
                                  &lt;TextBlock Text="{Binding}"/&gt;
                              &lt;/DataTemplate&gt;
                          &lt;/ListView.ItemTemplate&gt;
  
                      &lt;/ListView&gt;
                  &lt;/StackPanel&gt;
              &lt;/Border&gt;
          &lt;/Flyout&gt;
  
      &lt;/ResourceDictionary&gt;
  &lt;/Page.Resources&gt;
  
  &lt;Grid x:Name="LayoutRoot"&gt;
      &lt;Hub x:Name="Hub" x:Uid="Hub" &gt;
  
          &lt;HubSection x:Uid="Location_View" Header="Locations"
                      DataContext="{Binding Locations}" HeaderTemplate="{ThemeResource HubSectionHeaderTemplate}"&gt;
              &lt;HubSection.Resources&gt;
  
  
                  &lt;DataTemplate x:Key="Location_Item_Template"&gt;
  
                      &lt;ListView 
                          AutomationProperties.AutomationId="ItemListViewSection5"
                          AutomationProperties.Name="Items In Group"
                          SelectionMode="None"
                          IsItemClickEnabled="True"
                          ItemsSource="{Binding}"
                          ItemTemplate="{StaticResource LocationItem_Template}"
                          ItemClick="ItemView_ItemClick"
                          ContinuumNavigationTransitionInfo.ExitElementContainer="True"/&gt;
  
  
                  &lt;/DataTemplate&gt;
              &lt;/HubSection.Resources&gt;
  
              &lt;StaticResource ResourceKey="Location_Item_Template"/&gt;
  
          &lt;/HubSection&gt;
  
      &lt;/Hub&gt;
  &lt;/Grid&gt;
  </code></pre>
  
  <p> </p>
  
  <p>I tried setting the datacontext using paths etc, nothing seems to work and the inheritance not being overwritten correctly and DataContext is always null. </p>
  
  <p>Any help would be greatly appreciated.</p>