Setting inline style - resets local properties

This commit is contained in:
vakrilov
2015-07-03 11:38:41 +03:00
parent d74d9b8fbb
commit 6017a208a0
6 changed files with 38 additions and 9 deletions

View File

@@ -4,7 +4,7 @@ import pages = require("ui/page");
var vm = new observable.Observable();
// Event handler for Page "loaded" event attached in main-page.xml
export function pageLoaded(args: observable.EventData) {
vm.set("style", "background-image: url('~/tests/pages/test2.png'); \nborder-color: green; \nborder-radius: 20; \nborder-width: 4;");
vm.set("style", "background-image: url('~/pages/test2.png'); \nborder-color: green; \nborder-radius: 20; \nborder-width: 4;");
// Get the event sender
var page = <pages.Page>args.object;
page.bindingContext = vm;

View File

@@ -1,6 +1,6 @@
<Page loaded="pageLoaded">
<GridLayout style="background-image: url('~/pages/test2.png'); border-color: green; border-radius: 20; border-width: 4;" rows="*, auto">
<TextView text="{{ style }}" />
<GridLayout style="background-image: url('~/pages/test2.png'); background-repeat:repeat-y; background-position: center bottom; background-color: green; background-size: 25% 50%; border-radius: 20; border-width: 4;" rows="*, auto">
<TextView text="{{ style }}" backgorundColor="transparent"/>
<Button text="apply" horizontalAlignment="center" verticalAlignment="center" tap="applyTap" row="1"/>
</GridLayout>
</Page>