diff --git a/CrossPlatformModules.csproj b/CrossPlatformModules.csproj index 5378cc00e..3daeec9e5 100644 --- a/CrossPlatformModules.csproj +++ b/CrossPlatformModules.csproj @@ -212,6 +212,10 @@ xmlbasics.xml + + MyControl.xml + + @@ -709,6 +713,12 @@ + + + Designer + + + @@ -1591,6 +1601,12 @@ PreserveNewest + + PreserveNewest + + + PreserveNewest + diff --git a/apps/ui-tests-app/custom-components/mymodule/MyControl.css b/apps/ui-tests-app/custom-components/mymodule/MyControl.css new file mode 100644 index 000000000..d701672c7 --- /dev/null +++ b/apps/ui-tests-app/custom-components/mymodule/MyControl.css @@ -0,0 +1,3 @@ +.MyStackLayout { + background-color: red; +} diff --git a/apps/ui-tests-app/custom-components/mymodule/MyControl.ts b/apps/ui-tests-app/custom-components/mymodule/MyControl.ts new file mode 100644 index 000000000..aca0396d3 --- /dev/null +++ b/apps/ui-tests-app/custom-components/mymodule/MyControl.ts @@ -0,0 +1,24 @@ +import observable = require("data/observable"); +import stackLayoutModule = require("ui/layouts/stack-layout"); +import label = require("ui/label"); +import button = require("ui/button"); + +export class MyControl extends stackLayoutModule.StackLayout { + constructor() { + super(); + + var counter: number = 0; + + var lbl = new label.Label(); + var btn = new button.Button(); + btn.text = "Tap me!"; + btn.on(button.Button.tapEvent, (args: observable.EventData) => { + lbl.text = "Tap " + counter++; + }); + + this.addChild(lbl); + this.addChild(btn); + + this.cssClass = "MyStackLayout"; + } +} \ No newline at end of file diff --git a/apps/ui-tests-app/custom-components/mymodule/package.json b/apps/ui-tests-app/custom-components/mymodule/package.json new file mode 100644 index 000000000..55267b5f2 --- /dev/null +++ b/apps/ui-tests-app/custom-components/mymodule/package.json @@ -0,0 +1,2 @@ +{ "name" : "MyControl", + "main" : "MyControl.js" } \ No newline at end of file diff --git a/apps/ui-tests-app/custom-components/mymodulewithxml/MyControl.css b/apps/ui-tests-app/custom-components/mymodulewithxml/MyControl.css new file mode 100644 index 000000000..dd3ccf653 --- /dev/null +++ b/apps/ui-tests-app/custom-components/mymodulewithxml/MyControl.css @@ -0,0 +1,3 @@ +.MySecondCustomStackLayout { + background-color: green; +} diff --git a/apps/ui-tests-app/custom-components/mymodulewithxml/MyControl.ts b/apps/ui-tests-app/custom-components/mymodulewithxml/MyControl.ts new file mode 100644 index 000000000..532f0f6c5 --- /dev/null +++ b/apps/ui-tests-app/custom-components/mymodulewithxml/MyControl.ts @@ -0,0 +1,16 @@ +import observable = require("data/observable"); +import view = require("ui/core/view"); +import label = require("ui/label"); + +var count = 0; +export function buttonTap2(args: observable.EventData) { + count++; + + var parent = (args.object).parent; + if (parent) { + var lbl = parent.getViewById("Label1"); + if (lbl) { + lbl.text = "You clicked " + count + " times!"; + } + } +} \ No newline at end of file diff --git a/apps/ui-tests-app/custom-components/mymodulewithxml/MyControl.xml b/apps/ui-tests-app/custom-components/mymodulewithxml/MyControl.xml new file mode 100644 index 000000000..4fe8e30f7 --- /dev/null +++ b/apps/ui-tests-app/custom-components/mymodulewithxml/MyControl.xml @@ -0,0 +1,4 @@ + +