示例#1
0
        /// <summary>
        /// Builds MobileListView items.
        /// </summary>
        /// <param name="action">Action for declaratively building MobileListView items.</param>
        /// <code lang="CS">
        ///  &lt;% Html.Kendo().MobileListViewView()
        ///            .Name("View")
        ///            .Items(items =>
        ///            {
        ///                 items.Add().Text("Item");
        ///                 items.AddLink().Text("Link Item");
        ///             })
        ///            .Render();
        /// %&gt;
        /// </code>
        public MobileListViewBuilder <T> Items(Action <MobileListViewItemFactory> action)
        {
            var factory = new MobileListViewItemFactory(Component.Items, Component.ViewContext, Component.UrlGenerator);

            action(factory);

            return(this);
        }
示例#2
0
        /// <summary>
        /// Builds nested MobileListView items.
        /// </summary>
        /// <param name="action">Action for declaratively building MobileListView items.</param>
        /// <code lang="CS">
        ///  &lt;% Html.Kendo().MobileListViewView()
        ///            .Name("View")
        ///            .Items(items =>
        ///            {
        ///                 items.Add().Text("Master Item")
        ///                     .Items(masterItem =>
        ///                     {
        ///                         masterItem.Add().Text("Inner Item 1");
        ///                         masterItem.Add().Text("Inner Item 2");
        ///                     });
        ///             })
        ///            .Render();
        /// %&gt;
        /// </code>
        public virtual MobileListViewItemBuilder Items(Action <MobileListViewItemFactory> action)
        {
            var factory = new MobileListViewItemFactory(Item.Items, viewContext, urlGenerator);

            action(factory);

            return(this);
        }