public override void Load() { string tmpXML3 = @" <div el-bind:padding-top=""pt"" el-bind:width=""w"" el-bind:height=""styleObj.StyleHeight"" id=""root"" flex-wrap=""wrap"" justify-content=""center"" flex-direction=""row"" > <div el-for=""item in list"" el-if=""item != '2' "" el-bind:margin=""mt"" el-bind:id=""item"" width=""100px"" height=""100px""> my id is {{item}} <div el-for=""item in list"" el-if=""item != '2' "" el-bind:margin=""mt"" el-bind:id=""item"" width=""50px"" height=""50px""> my id is {{item}} <div el-for=""item in list"" el-if=""item != '2' "" el-bind:margin=""mt"" el-bind:id=""item"" width=""20px"" height=""20px""> my id is {{item}} <div el-for=""item in list"" el-if=""item != '2' "" el-bind:margin=""mt"" el-bind:id=""item"" width=""10px"" height=""10px""> my id is {{item}} <div el-for=""item in list"" el-if=""item != '2' "" el-bind:margin=""mt"" el-bind:id=""item"" width=""10px"" height=""10px""> my id is {{item}} </div> </div> </div> </div> </div> </div> "; userInterface.Build(tmpXML3); userInterface.SetBridge(printer); }
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(); } }
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); }
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 .. }
public override void Load() { string tmpXML3 = @" <div el-bind:padding-top=""pt"" el-bind:width=""w"" el-bind:height=""styleObj.StyleHeight"" id=""root"" flex-wrap=""wrap"" justify-content=""center"" flex-direction=""row"" > <div el-for=""item in list"" el-if=""item != '2' "" el-bind:margin=""mt"" el-bind:id=""item"" width=""100px"" height=""100px""> my id is {{item}} <div el-for=""item in list"" el-if=""item != '2' "" el-bind:margin=""mt"" el-bind:id=""item"" width=""50px"" height=""50px""> my id is {{item}} </div> </div> </div> "; string tmpXML = @" <div el-bind:padding-top=""pt"" el-bind:width=""w"" el-bind:height=""styleObj.StyleHeight"" id=""root"" flex-wrap=""wrap"" justify-content=""center"" flex-direction=""row"" > <div el-for=""item in list"" flex-wrap=""wrap"" el-if=""item != '2' "" el-bind:margin=""mt"" el-bind:id=""item"" width=""150px"" height=""150px""> my id is {{item}} <div el-for=""item in list"" flex-wrap=""wrap"" el-if=""item != '2' "" el-bind:id=""item"" width=""50px"" height=""50px""> my id is {{item}} </div> </div> </div> "; userInterface.Build(tmpXML); userInterface.SetData(new Dictionary <string, object>() { { "styleObj", this }, { "w", "620px" }, { "mt", "5px" }, { "pt", "15px" }, }); if (useFactory) { userInterface.SetBridge(fac); } userInterface.SetData("list", new List <string> { "a3" }); userInterface.Update(); System.Console.WriteLine("--------------------------------"); System.Console.WriteLine(userInterface.ToString()); System.Console.WriteLine("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"); System.Console.WriteLine(fac.ToString()); System.Console.WriteLine("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"); userInterface.SetData("list", new List <string> { "b3", "b5" }); userInterface.Update(); System.Console.WriteLine("--------------------------------"); System.Console.WriteLine(userInterface.ToString()); userInterface.SetData("list", new List <string> { "c1", "c2", "c3" }); 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()); userInterface.SetData("list", new List <string> { "c1", "c2", "c3" }); userInterface.Update(); System.Console.WriteLine("--------------------------------"); System.Console.WriteLine(userInterface.ToString()); userInterface.SetData("list", new List <string> { "b3", "b5" }); userInterface.Update(); System.Console.WriteLine("--------------------------------"); System.Console.WriteLine(userInterface.ToString()); }