1
,DSM由行标题和列标题组成,这些行标题和列标题具有相同的条目,并按相同的顺序排列。我想使表/矩阵/网格的单元格可以用两个文本框进行点击,以输入有关交叉点(行和列)的信息。
这就是我所做的。
单元格类:
public class Cell
{
public CellPosition Position { get; set; }
public Collection<Entry> Entries { get; set; }
public Collection<Rule> Rules { get; set; }
}
这是主窗口
public MainWindow()
{
InitializeComponent();
var irule = new Rule(1.ToString(), "Informal", "Some informal Rule", "All Chamfers are equal");
var frule = new Rule(2.ToString(), "Formal", "Some formal Rule", "chamfer.equal(all)");
var pos11 = new CellPosition(1.ToString(), 1.ToString());
var pos21 = new CellPosition(2.ToString(), 1.ToString());
var entry = new Entry("TableTop", "TableTop", "Test Case TableTop");
var entry1 = new Entry("TableFoot1", "TableFoot1", "The Foot of the table");
var entry2 = new Entry("TableFoot2", "TableFoot2", "Test Case TableFoot");
var entries = new List<Entry>();
entries.Add(entry);
entries.Add(entry1);
entries.Add(entry2);
var dsm = new DSM(entries);
foreach (var cell in dsm.Cells)
{
dsm.AddRuleToCell(cell, irule);
dsm.AddRuleToCell(cell, frule);
}
var kafaSession = new Session();
kafaSession.SaveModel(dsm, "C:\\OwnStuff\\TestFiles\\Results\\output.xml");
Console.WriteLine("Done!");
Console.ReadLine();
KafaGrid.ItemsSource = dsm.Cells;
}
DataGrid
Binding DataGrid to Design Structure Matrix
我也研究过数据表,但我不知道如何将列标题和行标题定义为相同的。。。