blob: aa9c8fbf908bbc17b7b381696fe5eb759c179feb (
plain)
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using Tango.Core;
using Tango.FSE.Diagnostics.Project.Widgets;
namespace Tango.FSE.Diagnostics.Project
{
public class DiagnosticsProjectTab : ExtendedObject
{
private String _name;
public String Name
{
get { return _name; }
set { _name = value; RaisePropertyChangedAuto(); }
}
public ObservableCollection<DiagnosticsProjectTabColumnDefinition> Columns { get; set; }
public ObservableCollection<DiagnosticsProjectTabRowDefinition> Rows { get; set; }
public ObservableCollection<DiagnosticsWidget> Widgets { get; set; }
public DiagnosticsProjectTab()
{
Columns = new ObservableCollection<DiagnosticsProjectTabColumnDefinition>();
Rows = new ObservableCollection<DiagnosticsProjectTabRowDefinition>();
Widgets = new ObservableCollection<DiagnosticsWidget>();
}
public static DiagnosticsProjectTab CreateNew(String name, int columns, int rows)
{
var tab = new DiagnosticsProjectTab();
tab.Name = name;
for (int i = 0; i < columns; i++)
{
tab.Columns.Add(CreateColumn());
}
for (int i = 0; i < rows; i++)
{
tab.Rows.Add(CreateRow());
}
return tab;
}
private static DiagnosticsProjectTabColumnDefinition CreateColumn()
{
return new DiagnosticsProjectTabColumnDefinition()
{
Width = new GridLength(1, GridUnitType.Star)
};
}
private static DiagnosticsProjectTabRowDefinition CreateRow()
{
return new DiagnosticsProjectTabRowDefinition()
{
Height = new GridLength(1, GridUnitType.Star)
};
}
}
}
|