예제 #1
0
        /// <summary>
        /// 动态创建磁贴项内容
        /// </summary>
        /// <param name="p_item"></param>
        /// <returns></returns>
        LvRow CreateTileItemByRowView(LvItem p_item)
        {
            var row = new TileRow(_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 CreateTileItemByTemplate(LvItem p_item)
        {
            var row = new TileRow(_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 CreateTileItemBySelector(LvItem p_item)
        {
            var temp = ((DataTemplateSelector)_owner.View).SelectTemplate(p_item);

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

            var row = new TileRow(_owner, temp);

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