title: How to sucessfully use a DataGrid control in Visual Studio 2019 with Avalonia 0.8.3
body: <p>I've started a brand new project in Visual Studio 2019 using the Avalonia MVVM Application template.  I've included the Avalonia, Avalonia.Desktop, Avalonia.Controls.DataGrid, and Avalonia.ReactiveUI packages from NuGet, and updated them all to version 0.8.3.  The first control I've attempted to put on my form is a DataGrid, backed by a simple PersonModel class.</p>
  
  <p>Every time I try to run the program, I get an error.  This is literally the first project I've tried to use Avalonia for, and I have very little experience with WPF or UWP, so I am completely lost.  Please help me figure out how to get a DataGrid on my form.</p>
  
  <p>Below are literally the only changes I've made to anything.  Everything else is exactly as the template laid it out, which worked until I tried to add the DataGrid.</p>
  
  <p>PersonModel.cs</p>
  
  <pre class="lang-cs prettyprint-override"><code>using System;
  using System.Collections.Generic;
  using System.Text;
  
  namespace MyrinaUI.Models {
      public class PersonModel {
          public int DepartmentNumber { get; set; }
          public string DeskLocation { get; set; }
          public int EmployeeNumber { get; set; }
          public string FirstName { get; set; }
          public string LastName { get; set; }
      }
  }
  </code></pre>
  
  <p>MainWindowViewModel.cs</p>
  
  <pre class="lang-cs prettyprint-override"><code>using MyrinaUI.Models;
  using System;
  using System.Collections.Generic;
  using System.Collections.ObjectModel;
  using System.Text;
  
  namespace MyrinaUI.ViewModels
  {
      public class MainWindowViewModel : ViewModelBase
      {
          public ObservableCollection&lt;PersonModel&gt; People { get; }
  
          public MainWindowViewModel() {
              People = new ObservableCollection&lt;PersonModel&gt;(GenerateMockPeopleTable());
          }
  
          private IEnumerable&lt;PersonModel&gt; GenerateMockPeopleTable() {
              var defaultPeople = new List&lt;PersonModel&gt;() {
                  new PersonModel() {
                      FirstName = "Pat",
                      LastName = "Patterson",
                      EmployeeNumber = 1010,
                      DepartmentNumber = 100,
                      DeskLocation = "B3F3R5T7"
                  },
                  new PersonModel() {
                      FirstName = "Jean",
                      LastName = "Jones",
                      EmployeeNumber = 1011,
                      DepartmentNumber = 101,
                      DeskLocation = "B3F3R5T8"
                  },
                  new PersonModel() {
                      FirstName = "Terry",
                      LastName = "Thompson",
                      EmployeeNumber = 2010,
                      DepartmentNumber = 200,
                      DeskLocation = "B3F3R5T9"
                  },
              };
  
              return defaultPeople;
          }
      }
  }
  </code></pre>
  
  <p>App.xaml:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;Application xmlns="https://github.com/avaloniaui"
               xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
               xmlns:local="clr-namespace:MyrinaUI"
               x:Class="MyrinaUI.App"&gt;
      &lt;Application.DataTemplates&gt;
          &lt;local:ViewLocator/&gt;
      &lt;/Application.DataTemplates&gt;
  
      &lt;Application.Styles&gt;
          &lt;StyleInclude Source="avares://Avalonia.Themes.Default/DefaultTheme.xaml"/&gt;
          &lt;StyleInclude Source="avares://Avalonia.Themes.Default/Accents/BaseDark.xaml"/&gt;
          &lt;StyleInclude Source="avares://Avalonia.Controls.DataGrid/Themes/Default.xaml"/&gt;
      &lt;/Application.Styles&gt;
  &lt;/Application&gt;
  </code></pre>
  
  <p>MainWindow.xaml</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;Window xmlns="https://github.com/avaloniaui"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          xmlns:vm="clr-namespace:MyrinaUI.ViewModels;assembly=MyrinaUI"
          xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
          xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
          mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
          x:Class="MyrinaUI.Views.MainWindow"
          Icon="/Assets/avalonia-logo.ico"
          Title="MyrinaUI"&gt;
  
      &lt;Design.DataContext&gt;
          &lt;vm:MainWindowViewModel/&gt;
      &lt;/Design.DataContext&gt;
  
    &lt;StackPanel&gt;
      &lt;DataGrid AutoGenerateColumns="True" Items="{Binding People}"/&gt;
    &lt;/StackPanel&gt; 
  &lt;/Window&gt;
  </code></pre>
  
  <p>The exception that is thrown is:
  System.IO.FileNotFoundException: 'The resource avares://Avalonia.Controls.DataGrid/Themes/Default.xaml could not be found.'</p>
  
  <p>Which seems pretty straight forward, but having looked at the source on GitHub and seen the file in question, I'm not sure where to look to make sure it exists locally, or if that would even help me.</p>
  
  <p>Removing that line from App.xaml results in:
  Portable.Xaml.XamlObjectWriterException: 'Cannot create unknown type '{<a href="https://github.com/avaloniaui" rel="nofollow noreferrer">https://github.com/avaloniaui</a>}DataGrid'.'</p>