title: DataTemplate x:Bind namespace error
body: <p>I have a question about Windows 10 UWP development using Visual Studio 2015.</p>
  
  <p>I'm trying to use a DataTemplate for my GridView according to <a href="https://msdn.microsoft.com/en-us/library/windows/apps/mt204776.aspx" rel="nofollow noreferrer">this</a> tutorial. The problem I'm having is with my namespace.</p>
  
  <p>I am not allowed to share my exact code for obvious reasons, but I'm wondering if one of you guys might have run into this before. I am getting almost the same error as <a href="https://stackoverflow.com/questions/31713873/xbf-error-with-datatemplate-in-application-resources">this</a> person (error code 0x09c4), except my DataTemplate is in my code-behind-file, not global like him/her. Along with that error I'm also getting the illusive "the _name does not exist in the namespace _namespace".</p>
  
  <p>Here is a piece of my xaml file:</p>
  
  <pre><code>&lt;Grid&gt;
  ...
      &lt;GridView ItemsSource="{x:Bind ViewModel.AssessExItems}"&gt;
          &lt;GridView.ItemTemplate&gt;
              &lt;DataTemplate x:DataType="local:AssessExItem"&gt;
  
              &lt;/DataTemplate&gt;
          &lt;/GridView.ItemTemplate&gt;
      &lt;/GridView&gt;
  &lt;/Grid&gt;
  </code></pre>
  
  <p>I know the DataTemplate is empty but even if I enter something there it still doesn't work. Here is my code-behind-file for this xaml file:</p>
  
  <pre><code>public sealed partial class AssessmentExample1Screen : Page
  {
      public AssessExItemViewModel ViewModel { get; set; }
  
      public AssessmentExample1Screen()
      {
          this.InitializeComponent();
          this.ViewModel = new AssessExItemViewModel();
      }
  }
  
  public class AssessExItem
  {
      public int _assessment_id { get; set; }
      public string name { get; set; }
      public string surname { get; set; }
      public string date { get; set; }
  
      //public EmpAssessItem() { }
  }
  
  public class AssessExItemViewModel
  {
      private ObservableCollection&lt;AssessExItem&gt; exampleItems = new ObservableCollection&lt;AssessExItem&gt;();
      public ObservableCollection&lt;AssessExItem&gt; AssessExItems { get { return this.exampleItems; } }
  
      public AssessExItemViewModel()
      {
          //for (int i = 1; i &lt; 3; i++)
          //{
          this.exampleItems.Add(new AssessExItem()
          {
              name = "Cat 777",
              surname = "Botha",
              date = "2015-03-22"
          });
          //}
          this.exampleItems.Add(new AssessExItem()
          {
              name = "XZR 678",
              surname = "Botha",
              date = "2015-03-22"
          });
          this.exampleItems.Add(new AssessExItem()
          {
              name = "TBL 123",
              surname = "Botha",
              date = "2015-03-22"
          });
      }
  }
  </code></pre>
  
  <p>Please help.</p>