-
Notifications
You must be signed in to change notification settings - Fork 3
/
DashboardData.cs
34 lines (32 loc) · 1.25 KB
/
DashboardData.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using System;
using System.Collections.ObjectModel;
namespace Sample {
public class DashboardData {
public ObservableCollection<DataRecord> Data { get; private set; }
public DashboardData() {
Data = GetData();
}
ObservableCollection<DataRecord> GetData() {
Random rnd = new Random();
ObservableCollection<DataRecord> recordList = new ObservableCollection<DataRecord>();
for(int series = 1; series < 4; series++) {
for(int argument = 1; argument < 5; argument++) {
DateTime startDate = DateTime.Now.AddDays(rnd.Next(10));
DateTime endDate = startDate.AddDays(rnd.Next(5));
recordList.Add(new DataRecord() {
SubTask = "Sub Task " + argument,
GlobalTask = "Task " + series,
StartDate = startDate,
EndDate = endDate });
}
}
return recordList;
}
}
public class DataRecord {
public string GlobalTask { get; set; }
public string SubTask { get; set; }
public DateTime StartDate { get; set; }
public DateTime EndDate { get; set; }
}
}