In this step, you'll add code to the RegionSalesData code file to create the Data Observable Collection.
- Double-click the RegionSalesData.cs code file to open it.
- Import the following namespaces:
C# |
Copy Code
|
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
|
- Below the namespaces, set up your code file's format:
C# |
Copy Code
|
namespace RegionSales
{
public class RegionSalesData
{
}
}
}
|
- Edit the RegionSalesData class so that it resembles the following sample:
C# |
Copy Code
|
public class RegionSalesData
{
public ObservableCollection<double> Data { get; set; }
public string State { get; set; }
public double TotalSales { get; set; }
public string TotalSalesFormatted
{
get
{
return String.Format("{0:c2}", this.TotalSales);
}
}
public double NetSales { get; set; }
}
|
In this step, you added code to the RegionSalesData code file. In the next step, you'll run your application.
See Also