From 9056482ddb0ce1c3011443cd808113d6ff388304 Mon Sep 17 00:00:00 2001 From: vakrilov Date: Thu, 5 Mar 2015 17:37:09 +0200 Subject: [PATCH 1/3] Settings app update --- CrossPlatformModules.csproj | 6 +- .../{main-page.css => app.css} | 0 apps/template-settings/app.ts | 4 + apps/template-settings/main-page.ts | 11 +-- apps/template-settings/main-page.xml | 2 +- apps/template-settings/view-model.ts | 75 +++++++++++++++++++ 6 files changed, 83 insertions(+), 15 deletions(-) rename apps/template-settings/{main-page.css => app.css} (100%) diff --git a/CrossPlatformModules.csproj b/CrossPlatformModules.csproj index 79200f9ac..c6db0b1f4 100644 --- a/CrossPlatformModules.csproj +++ b/CrossPlatformModules.csproj @@ -494,6 +494,7 @@ + @@ -691,9 +692,6 @@ - - main-page.xml - Designer @@ -1460,7 +1458,7 @@ False - + \ No newline at end of file diff --git a/apps/template-settings/main-page.css b/apps/template-settings/app.css similarity index 100% rename from apps/template-settings/main-page.css rename to apps/template-settings/app.css diff --git a/apps/template-settings/app.ts b/apps/template-settings/app.ts index 83670f56b..eb622839f 100644 --- a/apps/template-settings/app.ts +++ b/apps/template-settings/app.ts @@ -1,3 +1,7 @@ import application = require("application"); + +// Remove this in the AppBuilder templates +application.cssFile = "app/template-settings/app.css" + application.mainModule = "app/main-page"; application.start(); diff --git a/apps/template-settings/main-page.ts b/apps/template-settings/main-page.ts index 4544b3620..f41abd3da 100644 --- a/apps/template-settings/main-page.ts +++ b/apps/template-settings/main-page.ts @@ -1,6 +1,5 @@ import observable = require("data/observable"); import pages = require("ui/page"); -import dialogs = require("ui/dialogs"); import vmModule = require("./view-model"); var viewModel = vmModule.settingsViewModel; @@ -9,12 +8,4 @@ export function pageLoaded(args: observable.EventData) { // The page has loaded. var page = args.object; page.bindingContext = viewModel; -} - -export function promptName(args: observable.EventData) { - dialogs.prompt("Enter your name:", viewModel.name).then((promptResult) => { - if (promptResult.result) { - viewModel.set("name", promptResult.text); - } - }); -} +} \ No newline at end of file diff --git a/apps/template-settings/main-page.xml b/apps/template-settings/main-page.xml index dd43b0a44..3f09696ba 100644 --- a/apps/template-settings/main-page.xml +++ b/apps/template-settings/main-page.xml @@ -6,7 +6,7 @@