Ejemplo n.º 1
0
        static void Mainx(string[] args)
        {
            {
                ShadowPlay <LoveBridge.Element> userInterface = new ShadowPlay <LoveBridge.Element>();
                LoveBridge bridge = new LoveBridge();
                string     tmpXML = @"
<div flex-wrap=""wrap"" justify-content=""center"" flex-direction=""row"" el-bind:id="" 'root-id' "" >
    <div el-for=""item in list"" el-bind:id=""item"" width=""100px"" height=""100px"">
        my id is {{item}}
        <div el-for=""item in list"" el-bind:id=""item"" width=""100px"" height=""100px"">
            my id is {{item}}
        </div>
    </div>
</div>
";
                userInterface.Build(tmpXML);
                userInterface.SetBridge(bridge);
                userInterface.SetData("list", new List <string> {
                    "a3"
                });
                userInterface.Update();
                userInterface.Update();
                System.Console.WriteLine("--------------------------------");
                System.Console.WriteLine(userInterface.ToString());

                userInterface.SetData("list", new List <string> {
                });
                userInterface.Update();
                System.Console.WriteLine("--------------------------------");
                System.Console.WriteLine(userInterface.ToString());

                userInterface.SetData("list", new List <string> {
                    "a3"
                });
                userInterface.Update();
                System.Console.WriteLine("--------------------------------");
                System.Console.WriteLine(userInterface.ToString());


                System.Console.Read();
            }
        }
Ejemplo n.º 2
0
        public virtual void Start()
        {
            shadowPlay = new ShadowPlay <LoveBridge.Element>();

            var schema = DefineLayoutXml();

            if (schema == null)
            {
                throw new System.Exception("DefineLayoutXml should return xml document string !");
            }

            var           initData   = DefineInitialData();
            List <string> properties = new List <string>();

            properties.AddRange(initData.Keys);
            shadowPlay.Build(schema);
            shadowPlay.SetData(initData);
            bridge = new LoveBridge();
            shadowPlay.SetBridge(bridge);
        }