/// <summary>
        /// Create editable text
        /// </summary>
        /// <param name="data">data to show</param>
        /// <param name="ui">ui properties</param>
        public static UXTree CreateUXTree(Marshalling.MarshallingHash data, Marshalling.MarshallingHash ui)
        {
            UXTree tree = new UXTree();

            tree.Bind(data);
            tree.Bind(ui);
            return(tree);
        }
Esempio n. 2
0
        /// <summary>
        /// Create tree
        /// </summary>
        /// <param name="properties">props</param>
        /// <param name="id">id</param>
        /// <param name="first">first row</param>
        /// <param name="nexts">next rows</param>
        /// <returns>ux tree</returns>
        public static UXTree CreateTree(Marshalling.MarshallingHash properties, string id, UXRow first, params UXRow[] nexts)
        {
            UXTree t = UXTree.CreateUXTree("tree", () =>
            {
                List <UXRow> rows = new List <UXRow>();
                rows.Add(first);
                rows = rows.Concat(nexts).ToList();
                return(new Dictionary <string, dynamic>()
                {
                    { "Id", id },
                    { "children", rows }
                });
            });

            if (properties != null)
            {
                t.Bind(properties);
            }
            return(t);
        }