示例#1
0
 double MeasureRow(int row)
 {
     using (var tm = new TempMeasureHelper(this))
     {
         if (row >= cells.Count())
         {
             return(0);
         }
         var ret = cells.ElementAt(row).Cast <Object>().Select((x, i) =>
         {
             var ck = (row, i);
             if (CellViewIndex.ContainsKey(ck))
             {
                 return(CellViewIndex[ck].Height);
             }
             else
             {
                 return(tm.Measure(x).Request.Height);
             }
         }).Max();
         return(ret);
     }
 }
示例#2
0
 double MeasureColumn(int col)
 {
     using (var tm = new TempMeasureHelper(this))
     {
         var els = cells.Select(x => col < x.Count ? x[col] : new NullCol());
         if (els.All(x => x is NullCol))
         {
             return(0);
         }
         var ret = els.Select((x, i) =>
         {
             var ck = (i, col);
             if (CellViewIndex.ContainsKey(ck))
             {
                 return(CellViewIndex[ck].Width);
             }
             else
             {
                 return(tm.Measure(x).Request.Width);
             }
         }).Max();
         return(ret);
     }
 }