//InitialAgendaGridViewList private List <StackPanel> InitialAgendaGridViewList(List <Agenda> agendaList) { List <StackPanel> gridViewList = new List <StackPanel>(); for (int i = 0; i < agendaList.Count; i++) { int collisionCount = 1; //GridView gridView = CreateGridView(Colors.DarkGreen); double startHourMin = GetHourMin(agendaList[i].StartDateTime); double endHourMin = GetHourMin(agendaList[i].EndDateTime); double width = (endHourMin - startHourMin) * HourWidth; double height; double left = startHourMin * HourWidth; double top = LINE_PADDING; for (int j = 0; j < i; j++) { StackPanel iGridView = gridViewList[j]; double iLeft = iGridView.Margin.Left; double iRight = iLeft + iGridView.Width; if (top == iGridView.Margin.Top && iLeft <= left && left <= iRight) { top += HOUR_HEIGHT + LINE_PADDING; collisionCount++; j = 0; } } if (_collisionCount < collisionCount) { _collisionCount = collisionCount; } UILayout uiLayout = new UILayout(); width = width >= HOUR_MIN_WIDTH ? width : HOUR_MIN_WIDTH; height = HOUR_HEIGHT; StackPanel stackPanel = uiLayout.GetMode_B_StackPanel(width, height, left, top, startHourMin, endHourMin, "Test"); stackPanel.PointerPressed += OnPointerPressed; stackPanel.Tag = agendaList[i]; gridViewList.Add(stackPanel); } return(gridViewList); }
//InitialAgendaGridViewList private List<StackPanel> InitialAgendaGridViewList(List<Agenda> agendaList) { List<StackPanel> gridViewList = new List<StackPanel>(); for (int i = 0; i < agendaList.Count; i++) { int collisionCount = 1; //GridView gridView = CreateGridView(Colors.DarkGreen); double startHourMin = GetHourMin(agendaList[i].StartDateTime); double endHourMin = GetHourMin(agendaList[i].EndDateTime); double width = (endHourMin - startHourMin) * HourWidth; double height; double left = startHourMin * HourWidth; double top = LINE_PADDING; for (int j = 0; j < i; j++) { StackPanel iGridView = gridViewList[j]; double iLeft = iGridView.Margin.Left; double iRight = iLeft + iGridView.Width; if (top == iGridView.Margin.Top && iLeft <= left && left <= iRight) { top += HOUR_HEIGHT + LINE_PADDING; collisionCount++; j = 0; } } if (_collisionCount < collisionCount) { _collisionCount = collisionCount; } UILayout uiLayout = new UILayout(); width = width >= HOUR_MIN_WIDTH ? width : HOUR_MIN_WIDTH; height = HOUR_HEIGHT; StackPanel stackPanel = uiLayout.GetMode_B_StackPanel(width, height, left, top, startHourMin, endHourMin, "Test"); stackPanel.PointerPressed += OnPointerPressed; stackPanel.Tag = agendaList[i]; gridViewList.Add(stackPanel); } return gridViewList; }