c# - DataMatrix Wpf KeyValuePairMapping -
i trying build datamatrix in wpf needs have row , column headers, dynamically generated rows , columns , commands linked each cell. due this, unable use datagrid. there few solutions josh smith's data matrix , this. leaning towards former feel might able achieve want more elegantly that.
unlike example(demo1), don't know names or number of rows/columns before hand , stuck in generating keyvaluepair dictionary. below pseudocode comparing implementation mine. appreciate if pointed me in right direction. his code
class dataclass: { string columnname; int row1data; int row2data; } class matrixclass: matrixbase<string dataclass> { dictionary<string callback> rowvaluemap; delegate object callback(dataclass data); addmappings() { rowvaluemap.add("row1name", data=>data.row1data.tostring); } }
my implementation ??(code)
indicates part i'm unsure about
class mydataclass: { string columnname; string[] rownames; int[] rowdata; } class mymatrixclass: matrixbase<string mydataclass> { dictionary<??(callback1), ??(callback2)> rowvaluemap; delegate object callback(mydataclass data); delegate object callback2(mydataclass data); addmappings() { rowvaluemap.add(??(data=>data.rownames.tostring), ??(data=>data.rowdata.tostring)); } }
i realize doing way give me 1 ienumerable key & 1 ienumerable value, i'm lost on one.i appreciate or alternative suggestions achieve target. thanks
Comments
Post a Comment