diff --git a/CrossPlatformModules.csproj b/CrossPlatformModules.csproj index 89b37e2b2..d4cfc8abb 100644 --- a/CrossPlatformModules.csproj +++ b/CrossPlatformModules.csproj @@ -140,6 +140,8 @@ bindingContext_testPage.xml + + time-picker-tests-native.d.ts @@ -597,6 +599,8 @@ + + diff --git a/CrossPlatformModules.csproj.bak b/CrossPlatformModules.csproj.bak new file mode 100644 index 000000000..ce0a63a50 --- /dev/null +++ b/CrossPlatformModules.csproj.bak @@ -0,0 +1,1581 @@ + + + + 12.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + 1.4 + {2313F1BF-1F2D-4F11-806A-87927FA6A7C0} + {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + v4.5 + true + + + + + + + Cross + bin\ + commonjs + True + True + ES5 + + + bin\ + commonjs + True + ES5 + + + bin\ + commonjs + ES5 + True + + + commonjs + False + ES5 + + + bin\ + commonjs + True + ES5 + + + CrossPlatformModules + + + true + + + OnBuildSuccess + + + bin\ + + + + + + list-picker.xml + + + + main-page.xml + + + + + main-page.xml + + + list-view.xml + + + + main-page.xml + + + main-page.xml + + + + + + + + + main-page.xml + + + + + main-page.xml + + + + + main-page.xml + + + + + details-page.xml + + + main-page.xml + + + location-example.xml + + + + + + + + + + + + + + + + + + + page17.xml + + + + + + + + + bindingContext_testPage.xml + + + + + time-picker-tests-native.d.ts + + + + time-picker-tests-native.d.ts + + + + + + + segmented-bar-tests-native.d.ts + + + + segmented-bar-tests-native.d.ts + + + + date-picker-tests-native.d.ts + + + + date-picker-tests-native.d.ts + + + + + list-picker-tests-native.d.ts + + + list-picker-tests-native.d.ts + + + + + + + + + main-page.xml + + + + + + + + file-name-resolver.d.ts + + + image-source.d.ts + + + image-source.d.ts + + + image-source.d.ts + + + platform.d.ts + + + platform.d.ts + + + + + application.d.ts + + + + application.d.ts + + + color.d.ts + + + color.d.ts + + + + color.d.ts + + + + console-native.d.ts + + + console-native.d.ts + + + console.d.ts + + + + + declarations.d.ts + + + declarations.d.ts + + + + fps-meter.d.ts + + + + fps-native.d.ts + + + + fps-native.d.ts + + + + http-request.d.ts + + + http-request.d.ts + + + + + + + location.d.ts + + + location.d.ts + + + location.d.ts + + + + + + + + + + + + + + + main-page.xml + + + + + + + + + + + + + + + application-tests-common.ts + + + application-tests-common.ts + + + + + + + + + + + + + view-tests-common.ts + + + view-tests-common.ts + + + text.d.ts + + + + text.d.ts + + + + trace.d.ts + + + + list-picker.d.ts + + + list-picker.d.ts + + + + list-picker.d.ts + + + + placeholder.d.ts + + + placeholder.d.ts + + + placeholder.d.ts + + + tool-bar.d.ts + + + tool-bar.d.ts + + + + tool-bar.d.ts + + + segmented-bar.d.ts + + + segmented-bar.d.ts + + + segmented-bar.d.ts + + + + button.d.ts + + + content-view.d.ts + + + + + bindable.d.ts + + + + control-state-change.d.ts + + + + image-cache.d.ts + + + + image-cache.d.ts + + + image-cache.d.ts + + + absolute-layout.d.ts + + + dock-layout.d.ts + + + grid-layout.d.ts + + + layout.d.ts + + + + + + + + stack-layout.d.ts + + + + wrap-layout.d.ts + + + + + + + + + + + + view.d.ts + + + view.d.ts + + + + view.d.ts + + + frame.d.ts + + + frame.d.ts + + + + frame.d.ts + + + image.d.ts + + + + image.d.ts + + + label.d.ts + + + + label.d.ts + + + label.d.ts + + + page.d.ts + + + page.d.ts + + + + page.d.ts + + + progress.d.ts + + + search-bar.d.ts + + + slide-out.d.ts + + + slide-out.d.ts + + + + slide-out.d.ts + + + slider.d.ts + + + + + date-picker.d.ts + + + date-picker.d.ts + + + + date-picker.d.ts + + + time-picker.d.ts + + + time-picker.d.ts + + + + time-picker.d.ts + + + text-field.d.ts + + + text-field.d.ts + + + + text-field.d.ts + + + + + + utils.d.ts + + + + utils.d.ts + + + + + timer.d.ts + + + + + timer.d.ts + + + + file-system-access.d.ts + + + file-system-access.d.ts + + + application.d.ts + + + + application-settings.d.ts + + + application-settings.d.ts + + + + + + + + + + + + + + + + Designer + + + + + + + + + + + + + + + + + + + + + + + + + + + Designer + + + + Designer + + + + + + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + observable.d.ts + + + dialogs.d.ts + + + + dialogs.d.ts + + + + + button.d.ts + + + button.d.ts + + + + slider.d.ts + + + + switch.d.ts + + + switch.d.ts + + + switch.d.ts + + + + border.d.ts + + + border.d.ts + + + border.d.ts + + + + activity-indicator.d.ts + + + activity-indicator.d.ts + + + progress.d.ts + + + + progress.d.ts + + + + search-bar.d.ts + + + search-bar.d.ts + + + + list-view.d.ts + + + list-view.d.ts + + + + scroll-view.d.ts + + + scroll-view.d.ts + + + scroll-view.d.ts + + + + slider.d.ts + + + + + + + + + + + PreserveNewest + + + + + + + Designer + + + + camera.d.ts + + + camera.d.ts + + + camera.d.ts + + + + http.d.ts + + + file-system.d.ts + + + + + + + + + + MyControl.xml + + + Always + + + Always + + + + + + + + + + + + dialogs.xml + + + + + + + + + + + + + + + + Designer + + + Designer + + + + Designer + + + Designer + + + + + + + + + main-page.xml + + + Designer + + + Designer + + + + + + + + + + easysax.d.ts + + + + + + + observable-array.d.ts + + + + + + + + + xml.d.ts + + + + virtual-array.d.ts + + + + common.d.ts + + + + + + + + esprima.d.ts + + + + polymer-expressions.d.ts + + + reworkcss.d.ts + + + + mainPage.xml + + + + text-field-tests-native.d.ts + + + text-field-tests-native.d.ts + + + details-page.xml + + + + + + main-page.xml + + + Designer + + + + + text-view-tests-native.d.ts + + + text-view-tests-native.d.ts + + + + + + + + label-tests-native.d.ts + + + label-tests-native.d.ts + + + Designer + + + + + + + + + + + + + + + + + + login.xml + + + + news.xml + + + + + + + + + + + + controls-page.d.ts + + + + + + native-calls-wrapper.d.ts + + + native-calls-wrapper.d.ts + + + + + + + + + tests.d.ts + + + + tests-native.d.ts + + + tests-native.d.ts + + + + + + + nav-page.d.ts + + + + + + + image.d.ts + + + activity-indicator.d.ts + + + dependency-observable.d.ts + + + + gestures.d.ts + + + gestures.d.ts + + + gestures.d.ts + + + list-view.d.ts + + + + + + + + stylers.d.ts + + + stylers.d.ts + + + stylers.d.ts + + + + utils.d.ts + + + + + + button-tests-native.d.ts + + + button-tests-native.d.ts + + + styling.d.ts + + + + + + + tab-view.d.ts + + + tab-view.d.ts + + + tab-view.d.ts + + + + + tab-view-tests-native.d.ts + + + tab-view-tests-native.d.ts + + + + + + + + + + + + page-tests-common.ts + + + page-tests-common.ts + + + + builder.d.ts + + + + text-base.d.ts + + + text-view.d.ts + + + text-view.d.ts + + + text-view.d.ts + + + + weak-event-listener.d.ts + + + + types.d.ts + + + + proxy.d.ts + + + + visual-state-constants.d.ts + + + + enums.d.ts + + + component-builder.d.ts + + + template-builder.d.ts + + + + + + + span.d.ts + + + span.d.ts + + + span.d.ts + + + + formatted-string.d.ts + + + formatted-string.d.ts + + + formatted-string.d.ts + + + web-view.d.ts + + + web-view.d.ts + + + web-view.d.ts + + + editable-text-base.d.ts + + + editable-text-base.d.ts + + + editable-text-base.d.ts + + + + + + + + + + + + + + + + + + + + + + PreserveNewest + + + + + PreserveNewest + + + + + PreserveNewest + + + + + PreserveNewest + + + + + PreserveNewest + + + + + PreserveNewest + + + + + PreserveNewest + + + + + PreserveNewest + + + + + PreserveNewest + + + + + PreserveNewest + + + + + + + + + + + PreserveNewest + + + + + PreserveNewest + + + + + PreserveNewest + + + + + PreserveNewest + + + + + PreserveNewest + + + + + PreserveNewest + + + + + PreserveNewest + + + + + PreserveNewest + + + + + PreserveNewest + + + + + PreserveNewest + + + + + PreserveNewest + + + + + PreserveNewest + + + + + PreserveNewest + + + + + PreserveNewest + + + + + PreserveNewest + + + + + PreserveNewest + + + + + + + + PreserveNewest + + + + + PreserveNewest + + + + + + + + + + + + + + + PreserveNewest + + + + + + + + + + + + + PreserveNewest + + + + + + + + + + + + + PreserveNewest + + + + + + + + PreserveNewest + + + + + + + + + + + + PreserveNewest + + + + + + + + + + + + + + + + + + + + + + + PreserveNewest + + + + + + + + + + + + + + + + + + + + + PreserveNewest + + + + + PreserveNewest + + + + + PreserveNewest + + + + + + + + PreserveNewest + + + + + + + + + + + PreserveNewest + + + PreserveNewest + + + + + + + + + + + PreserveNewest + + + + + + + + PreserveNewest + + + + + + + PreserveNewest + + + + + PreserveNewest + + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + + + + + + + + + + + + + + + + true + + true + 1.3.0 + node_modules\.bin + tsc.cmd + true + + + + $(BuildDependsOn);CompileAndPack; + + + + + + + --leavecomments=true + --runtslint=true + --runtslint=false + + + + + + + + + + + + + True + True + 0 + / + http://localhost:3128/ + False + False + + + False + + + + + + \ No newline at end of file diff --git a/apps/tests/ui/bindable-tests.ts b/apps/tests/ui/bindable-tests.ts index 09276a554..51ce2c5b9 100644 --- a/apps/tests/ui/bindable-tests.ts +++ b/apps/tests/ui/bindable-tests.ts @@ -11,6 +11,7 @@ import pageModule = require("ui/page"); import stackLayoutModule = require("ui/layouts/stack-layout"); import bindingBuilder = require("ui/builder/binding-builder"); import labelModule = require("ui/label"); +import textFieldModule = require("ui/text-field"); // // For information and examples how to use bindings please refer to special [**Data binding**](../../../../bindings.md) topic. @@ -472,5 +473,21 @@ export var test_TwoElementsBindingToSameBindingContext = function () { TKUnit.assertEqual(upperStackLabel.text, label2.text); } - helper.navigateToModuleAndRunTest("./tests/ui/bindingContext_testPage", testFunc); + helper.navigateToModuleAndRunTest("./tests/ui/bindingContext_testPage", null, testFunc); +} + +export var test_BindingContext_NavigatingForwardAndBack = function () { + var expectedValue = "Tralala"; + var testFunc = function (page: pageModule.Page) { + var innerTestFunc = function (childPage: pageModule.Page) { + var testTextField: textFieldModule.TextField = (childPage.getViewById("testTextField")); + testTextField.text = expectedValue; + }; + + helper.navigateToModuleAndRunTest("./tests/ui/bindingContext_testPage2", page.bindingContext, innerTestFunc); + var testLabel: labelModule.Label = (page.getViewById("testLabel")); + TKUnit.assertEqual(testLabel.text, expectedValue); + } + + helper.navigateToModuleAndRunTest("./tests/ui/bindingContext_testPage1", null, testFunc); } \ No newline at end of file diff --git a/apps/tests/ui/bindingContext_testPage1.ts b/apps/tests/ui/bindingContext_testPage1.ts new file mode 100644 index 000000000..c5e54096f --- /dev/null +++ b/apps/tests/ui/bindingContext_testPage1.ts @@ -0,0 +1,16 @@ +import frame = require("ui/frame"); +import observable = require("data/observable"); +import pageModule = require("ui/page"); + +function loadViewModel() { + viewModel.set("testProperty", "Alabala"); +} + +var viewModel = new observable.Observable(); + +loadViewModel(); + +export function pageLoaded(args: observable.EventData) { + var page = args.object; + page.bindingContext = viewModel; +} \ No newline at end of file diff --git a/apps/tests/ui/bindingContext_testPage1.xml b/apps/tests/ui/bindingContext_testPage1.xml new file mode 100644 index 000000000..0327a08bb --- /dev/null +++ b/apps/tests/ui/bindingContext_testPage1.xml @@ -0,0 +1,7 @@ + + + + + + diff --git a/apps/tests/ui/bindingContext_testPage2.ts b/apps/tests/ui/bindingContext_testPage2.ts new file mode 100644 index 000000000..91c4cafd2 --- /dev/null +++ b/apps/tests/ui/bindingContext_testPage2.ts @@ -0,0 +1,6 @@ +import pageModule = require("ui/page"); + +export function pageNavigatedTo(args: pageModule.NavigatedData) { + var page = args.object; + page.bindingContext = args.context; +} \ No newline at end of file diff --git a/apps/tests/ui/bindingContext_testPage2.xml b/apps/tests/ui/bindingContext_testPage2.xml new file mode 100644 index 000000000..c60d58270 --- /dev/null +++ b/apps/tests/ui/bindingContext_testPage2.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/apps/tests/ui/helper.ts b/apps/tests/ui/helper.ts index 33288f30f..04cff1d1b 100644 --- a/apps/tests/ui/helper.ts +++ b/apps/tests/ui/helper.ts @@ -143,8 +143,8 @@ export function buildUIAndRunTest(controlToTest, testFunction, pageCss?) { } } -export function navigateToModuleAndRunTest(moduleName, testFunction) { - navigateToModule(moduleName); +export function navigateToModuleAndRunTest(moduleName, context, testFunction) { + navigateToModule(moduleName, context); try { testFunction(frame.topmost().currentPage); } @@ -201,9 +201,9 @@ export function navigate(pageFactory: () => page.Page) { TKUnit.waitUntilReady(() => { return frame.topmost().currentPage !== currentPage; }); } -export function navigateToModule(moduleName: string) { +export function navigateToModule(moduleName: string, context?: any) { var currentPage = frame.topmost().currentPage; - frame.topmost().navigate({ moduleName: moduleName, animated: false }); + frame.topmost().navigate({ moduleName: moduleName, context: context, animated: false }); TKUnit.waitUntilReady(() => { return frame.topmost().currentPage !== currentPage; }); TKUnit.assert(frame.topmost().currentPage.isLoaded, "Current page should be loaded!"); }