Пример #1
0
        /// <summary>
        /// 动态创建行内容
        /// </summary>
        /// <param name="p_item"></param>
        /// <returns></returns>
        LvRow CreateListRowByRowView(LvItem p_item)
        {
            var row = new ListRow(_owner, (IRowView)_owner.View, p_item);

            if (p_item != null)
            {
                row.SetViewRow(p_item, false);
            }
            return(row);
        }
Пример #2
0
        /// <summary>
        /// 由模板生成行内容
        /// </summary>
        /// <param name="p_item"></param>
        /// <returns></returns>
        LvRow CreateListRowByTemplate(LvItem p_item)
        {
            var row = new ListRow(_owner, (DataTemplate)_owner.View);

            if (p_item != null)
            {
                row.SetViewRow(p_item, false);
            }
            return(row);
        }
Пример #3
0
        /// <summary>
        /// 由模板选择器生成行内容
        /// </summary>
        /// <param name="p_item"></param>
        /// <returns></returns>
        LvRow CreateListRowBySelector(LvItem p_item)
        {
            var temp = ((DataTemplateSelector)_owner.View).SelectTemplate(p_item);

            if (temp == null)
            {
                throw new Exception("未指定行模板!");
            }

            var row = new ListRow(_owner, temp);

            if (p_item != null)
            {
                row.SetViewRow(p_item, false);
            }
            return(row);
        }