Пример #1
0
        /// <summary>
        /// Create default template items
        /// </summary>
        private void CreateDefaultTemplateItems()
        {
            //default template item content
            string content = TemplateItemDisplayContent;

            //content width
            float width = GetDefaultTemplateItemControlWidth(content);

            //the maximum of the column displayed in the control
            int maxColumn = (int)(DefaultWidth / width);

            if (maxColumn == 0)
            {
                maxColumn = 1;
            }

            //template items total count
            int count = Column < maxColumn && Column != 0 ? TemplateItemCountPerColumn * Column : TemplateItemCountPerColumn * maxColumn;

            _tempItems.Clear();

            for (int i = 0; i < count; i++)
            {
                _tempItems.Add(new TemplateItem {
                    Caption = content
                });
            }
        }