示例#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();
            }
        }
示例#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);
        }
示例#3
0
        public LayoutController() : base(nameof(LayoutController) + ".root.object")
        {
            shadowPlay = new ShadowPlay <Element>();

            var schema = DefineLayoutDocument();

            if (schema == null)
            {
                throw new System.Exception(nameof(DefineLayoutDocument) + " return an unexpected null!");
            }

            var initData = DefineInitialData();

            shadowPlay.Build(schema);
            shadowPlay.SetData(initData);
            bridge = new Bridge(shadowPlay, CreateElementCheck, SetRootParent);
            shadowPlay.SetBridge(bridge);

            //Update(); // not call virtual method in ..
        }
示例#4
0
 public virtual void Draw(float x, float y, ShadowPlay <LoveBridge.Element> .DrawNodeFunc defaultDrawFunc, Dictionary <string, ShadowPlay <LoveBridge.Element> .DrawNodeFunc> themeDictionary = null)
 {
     shadowPlay.Draw(x, y, defaultDrawFunc, themeDictionary);
 }
示例#5
0
 public Bridge(ShadowPlay <Element> shadowPlay, CreateUIElementDelegate createUIFunc, SetRootParentDelegate setRootParentUIFunc)
 {
     this.createUIFunc        = createUIFunc;
     this.setRootParentUIFunc = setRootParentUIFunc;
     this.shadowPlay          = shadowPlay;
 }