title: json to new listbox item in windows store app C#
body: <p>I have an app for windows 8 that needs to take a Json string and deseriaizes it into DATACONTRACTS and it will display the information I wish in a Listbox that will have a max height and will scroll if greater than the max height.</p>
  
  <p>The problem that im having it not so much as not being able to do it but rather not knowing how to do it.</p>
  
  <p>So far I can deserialize the Json and I can specify where I want each item to go into the UI but what im trying to do is basically a for each item in the array I want it to make a new Stackpanel formatted with Textblocks that will have the information from the Json. I don't know how to this unfortunately and I don't really know what im searching for to get tutorials on how to do it</p>
  
  <p>This is the code I have that takes the items from the json with a helper class and puts them in the Text of the TextBlocks.</p>
  
  <pre><code>var _FilterSaleList = new FilterSalesList();
  var _Sales = await _FilterSaleList.FindSalesbyFilters();
  string _SaleName = _Sales.sales[0].name.ToString();
  string _SaleDescription = _Sales.sales[0].description.ToString();
  string _SaleName1 = _Sales.sales[1].name.ToString();
  string _SaleDescription1 = _Sales.sales[1].description.ToString();
  int _TotalResults = _Sales.sales.Length;
  SaleTitle.Text = _SaleName;
  SaleDescription.Text = _SaleDescription;
  SaleTitle1.Text = _SaleName1;
  SaleDescription1.Text = _SaleDescription1;
  </code></pre>
  
  <p>This is the XAML code for the Listbox with 2 Stack panels already in it.</p>
  
  <pre><code>&lt;ListBox Grid.Row="1"&gt;
      &lt;StackPanel Margin="0,0,0,5"&gt;
          &lt;TextBlock x:Name="SaleTitle" Text="" HorizontalAlignment="Center" Margin="0,0,0,5"/&gt;
          &lt;TextBlock x:Name="SaleDescription" Text="" HorizontalAlignment="Center" MaxHeight="40" Margin="0,0,0,5" TextWrapping="Wrap"/&gt;                        
      &lt;/StackPanel&gt;
      &lt;StackPanel Margin="0,0,0,5"&gt;
          &lt;TextBlock x:Name="SaleTitle1" Text="" HorizontalAlignment="Center" Margin="0,0,0,5"/&gt;
          &lt;TextBlock x:Name="SaleDescription1" Text="" HorizontalAlignment="Center" MaxHeight="40" Margin="0,0,0,5" TextWrapping="Wrap"/&gt;
      &lt;/StackPanel&gt;
  &lt;/ListBox&gt;
  </code></pre>
  
  <p>Below is an image of how I would like it to look.
  even though everything works this way like I said I would like it so that each item from the json will make a new stackpanel and display the information as in the image. I don't know what its called when this is done so even a simple hint as to where to look would be great!</p>
  
  <p><a href="http://puu.sh/2biMZ" rel="nofollow">http://puu.sh/2biMZ</a></p>