/
MainWindow.xaml.cs
43 lines (30 loc) · 1.01 KB
/
MainWindow.xaml.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
35
36
37
38
39
40
41
42
43
using System;
using System.Collections;
using System.Collections.ObjectModel;
using System.Windows;
namespace SparklineEdit {
public partial class MainWindow : Window {
public IList SourceCollection { get; set; }
public MainWindow() {
InitializeComponent();
grid.DataContext = this;
GenerateData(7);
}
private void GenerateData(int n) {
SourceCollection = new ObservableCollection<CustomElement>();
Random rnd = new Random();
for (int i = 1; i <= n; i++) {
SourceCollection.Add(new CustomElement() {
ArgumentColumn = new DateTime(2000, 1, i),
ValueColumn = rnd.Next(20),
FilteringColumn = 1
});
}
}
}
public class CustomElement {
public object ArgumentColumn { get; set; }
public int ValueColumn { get; set; }
public int FilteringColumn { get; set; }
}
}