private void RecomputeGrid()
        {
            if (gridSize.Width < 200)
            {
                return;
            }

            var newGridViewDivision  = GetDevisionForWidth(gridSize.Width);
            var slotLengthInSeconds  = GetSlotLengthInSeconds(newGridViewDivision);
            var timeSlotDuration     = new Duration(timeSlotEnd, timeSlotStart);
            var excactTimeSlotCount  = (double)timeSlotDuration.Seconds / slotLengthInSeconds;
            int roundedTimeSlotCount = (int)Math.Floor(excactTimeSlotCount);
            var timeSlotWidth        = gridSize.Width / excactTimeSlotCount;

            if (newGridViewDivision != gridViewDivisionState || TimeSlotLabels.Count == 0)
            {
                gridViewDivisionState = newGridViewDivision;
                CreateGridDrawing(roundedTimeSlotCount, excactTimeSlotCount,
                                  slotLengthInSeconds, timeSlotWidth);
            }
            else
            {
                UpdateGridDrawing(roundedTimeSlotCount, excactTimeSlotCount, timeSlotWidth);
            }
        }
        private static uint GetSlotLengthInSeconds(GridViewDivisionState gridViewDivisionState)
        {
            switch (gridViewDivisionState)
            {
            case GridViewDivisionState.QuarterHours: return(900);

            case GridViewDivisionState.HalfHours:    return(1800);

            case GridViewDivisionState.Hours:        return(3600);

            case GridViewDivisionState.TwoHours:     return(7200);
            }
            throw new ArgumentException();
        }