//public float CalculateDynamicCellWidth(TLEPanelCell element) //{ // var frame = element.AnimationElement as AnimationRouteFrame; // if(frame != null) // { // var diffTime = EndTime - StartTime; // var cellWidth = ((float)frame.FrameTime.Ticks / diffTime.Ticks) * Placement.Width; // return cellWidth; // } // throw new Exception("Nesu: Unable to calculate dynamic cell width"); //} public KeyValuePair <TimeSpan, List <TLEPanelCell> > GetStackedElementsForTimeSpan(TimeSpan timespan) { var timespanKey = StackedElements.Where(w => w.Key == timespan).Max(m => m.Key); return(new KeyValuePair <TimeSpan, List <TLEPanelCell> >(timespanKey, StackedElements[timespanKey])); }
public int CalculateMaxElementsAtColumn() { return(StackedElements.Max(w => w.Value.ToList().Count)); }