Ejemplo n.º 1
0
        /// <summary>
        /// Calculates the max count of visible items for specified items.
        /// </summary>
        protected virtual void CalculateMaxVisibleItems(ObservableList <TItem> items)
        {
            var height = GetScrollSize();

            maxVisibleItems = items.OrderBy <TItem, float>(GetItemHeight).TakeWhile(x => {
                height -= x.Height;
                return(height > 0);
            }).Count() + 2;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Calculates the max count of visible items for specified items.
        /// </summary>
        /// <param name="items">Items.</param>
        protected virtual void CalculateMaxVisibleItems(ObservableList <TItem> items)
        {
            var width = GetScrollSize();

            maxVisibleItems = items.OrderBy <TItem, float>(GetItemWidth).TakeWhile(x => {
                width -= x.Width;
                return(width > 0);
            }).Count() + 2;
        }