title: How can I use a class or a ViewModel as the datasource for a ListView with DataTemplate that will show in Design View without compilation?
body: <p>I am trying to quickly style a DataGrid with DataTemplates and instead of relying on a compiled runtime DataSource, I want to quickly create a DataSource that can be used as the ItemsSource of my ListView to quickly edit the Styling.</p>
  <p>C# Code</p>
  <pre><code>    public class SampleViewModel
  {
      #region fields
      private ObservableCollection&lt;DATA&gt; datas;
      #endregion fields
  
      #region properties
      public ObservableCollection&lt;DATA&gt; DATAs { get { return this.datas; } }
      #endregion properties
  
      #region constructors
      public SampleViewModel()
      {
          // Establish the invariant of owning a collection of BookSku.
          this.datas = new ObservableCollection&lt;DATA&gt;();
  
          if (DesignMode.DesignModeEnabled)
          {
              DataSource.LoadSampleDATAs(ref this.datas);
          }
          else
          {
              DataSource.LoadSampleDATAsfromCloud(ref this.datas);
          }
      }
      #endregion constructors
  }
  
  public class DATA
  {
      #region properties
      public DateTime Date { get; internal set; }
      public string ProvNum { get; internal set; }
      public decimal Fees { get; internal set; }
      #endregion properties
  }
  
  internal static class DataSource
  {
      #region methods
      public static void LoadSampleDATAs(ref ObservableCollection&lt;DATA&gt; datas)
      {
          datas.Add(new DATA()
          {
              Date = DateTime.Today.AddDays(-1),
              ProvNum = &quot;1&quot;,
              Fees = (decimal)150
          });
          datas.Add(new DATA()
          {
              Date = DateTime.Today.AddDays(-2),
              ProvNum = &quot;2&quot;,
              Fees = (decimal)250
          });
      }
  
      public static void LoadSampleDATAsfromCloud(ref ObservableCollection&lt;DATA&gt; datas)
      {
          // In this simple app, we'll simulate real-world data access by loading sample data.
          DataSource.LoadSampleDATAs(ref datas);
      }
      #endregion methods
  }
  </code></pre>
  <p>XAML Code</p>
  <pre><code>&lt;Page.DataContext&gt;
          &lt;services:SampleViewModel/&gt;
      &lt;/Page.DataContext&gt;
  &lt;syncfusion:SfDataGrid ItemsSource=&quot;{Binding DATAs}&quot;/&gt;
  </code></pre>
  <p>The Binding works at runtime but still does not work in design view and the Grid Shows up but doesn't show the Items. What am I doing wrong?</p>