Update binding test pages.

This commit is contained in:
Vasil Chimev
2015-07-07 14:38:32 +03:00
parent 3b323cd846
commit c5748bf73b
6 changed files with 44 additions and 32 deletions

View File

@ -208,8 +208,10 @@
</TypeScriptCompile>
<TypeScriptCompile Include="apps\editable-text-demo\model.ts" />
<TypeScriptCompile Include="apps\tests\weak-event-listener-tests.ts" />
<TypeScriptCompile Include="apps\ui-tests-app\bindings\dbxmlbasics.ts" />
<TypeScriptCompile Include="apps\ui-tests-app\bindings\dbbasics.ts" />
<TypeScriptCompile Include="apps\ui-tests-app\bindings\xmlbasics.ts">
<DependentUpon>xmlbasics.xml</DependentUpon>
</TypeScriptCompile>
<TypeScriptCompile Include="apps\ui-tests-app\bindings\basics.ts" />
<TypeScriptCompile Include="apps\ui-tests-app\layouts\absolute.ts" />
<TypeScriptCompile Include="apps\ui-tests-app\layouts\dock.ts" />
<TypeScriptCompile Include="apps\ui-tests-app\layouts\grid.ts" />
@ -701,7 +703,7 @@
<Content Include="apps\tests\xml-declaration\mymodulewithxml\my-control-no-js.xml">
<SubType>Designer</SubType>
</Content>
<Content Include="apps\ui-tests-app\bindings\dbxmlbasics.xml" />
<Content Include="apps\ui-tests-app\bindings\xmlbasics.xml" />
<Content Include="apps\ui-tests-app\layouts\absolute.xml" />
<Content Include="apps\ui-tests-app\layouts\dock.xml" />
<Content Include="apps\ui-tests-app\layouts\grid.xml" />

View File

@ -6,7 +6,7 @@ export function alertTapped(args) {
export function alertWithOptionsTapped(args) {
dialogs.alert({
title: "Alert",
title: "Alert Title",
message: "Hi there!",
okButtonText: "Close"
});
@ -18,7 +18,7 @@ export function confirmTapped(args) {
export function confirmWithOptionsTapped(args) {
dialogs.confirm({
title: "Confirm",
title: "Confirm Title",
message: "Are you sure?",
okButtonText: "OK",
cancelButtonText: "Cancel",
@ -27,13 +27,13 @@ export function confirmWithOptionsTapped(args) {
}
export function promptTapped(args) {
dialogs.prompt("Enter name", "John Doe");
dialogs.prompt("Enter name:", "John Doe");
}
export function promptWithOptionsTapped(args) {
dialogs.prompt({
title: "Prompt",
message: "Enter name",
title: "Prompt Title",
message: "Enter name:",
okButtonText: "OK",
cancelButtonText: "Cancel",
neutralButtonText: "Ignore",
@ -44,8 +44,8 @@ export function promptWithOptionsTapped(args) {
export function promptWithOptionsPasswordTapped(args) {
dialogs.prompt({
title: "Prompt",
message: "Enter name",
title: "Prompt Title",
message: "Enter name:",
okButtonText: "OK",
cancelButtonText: "Cancel",
neutralButtonText: "Ignore",
@ -55,19 +55,18 @@ export function promptWithOptionsPasswordTapped(args) {
}
export function loginTapped(args) {
dialogs.login("Login:", "username", "pwd").then(r=> console.log(`Login result: ${r.result}, user: ${r.userName}, pwd: ${r.password}`));
dialogs.login("Enter user/pass:", "username", "password").then(r=> console.log(`Login result: ${r.result}, user: ${r.userName}, pwd: ${r.password}`));
}
export function loginWithOptionsTapped(args) {
dialogs.login({
title: "Login",
message: "Enter user/pwd",
title: "Login Title",
message: "Enter user/pass:",
okButtonText: "OK",
cancelButtonText: "Cancel",
neutralButtonText: "Ignore",
defaultText: "John Doe",
userName: "USER",
password: "PWD"
userName: "username",
password: "password"
}).then(r=> console.log(`Login result: ${r.result}, user: ${r.userName}, pwd: ${r.password}`));
}

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Page>
<ScrollView>
<StackLayout>
<Button text="alert" tap="alertTapped"/>
<Button text="alert with options" tap="alertWithOptionsTapped"/>
@ -13,4 +14,5 @@
<Button text="action" tap="actionTapped"/>
<Button text="action with options" tap="actionWithOptionsTapped"/>
</StackLayout>
</ScrollView>
</Page>

View File

@ -14,12 +14,21 @@ export function createPage() {
var targetTwoWay = new textFieldModule.TextField();
var buttonOneWay = new buttonModule.Button();
var buttonTwoWay = new buttonModule.Button();
var buttonSetText = new buttonModule.Button();
targetOneWay.id = "textFieldOneWay";
targetTwoWay.id = "textFieldTwoWay";
buttonOneWay.id = "buttonOneWay";
buttonTwoWay.id = "buttonTwoWay";
buttonSetText.id = "buttonSetText";
buttonSetText.text = "SetText";
buttonSetText.on(buttonModule.Button.tapEvent, function () {
targetOneWay.text = "Test";
targetTwoWay.text = "Test";
});
stack.addChild(buttonSetText);
// OneWay Binding
var bindingOptionOneWay = {
sourceProperty: "textSource",

View File

@ -1,8 +1,8 @@
<Page>
<StackLayout>
<StackLayout loaded="stack0Loaded" orientation="horizontal">
<TextField id="tf" text="{{ textSource }}" />
<Button id="btn" />
<TextField id="tf" text="{{ textSource }}" width="150" />
<Button id="btn" width="150" />
</StackLayout>
<StackLayout loaded="stack1Loaded">
<Label id="label" text="{{ text }}" />