mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 03:31:45 +08:00
23 lines
664 B
TypeScript
23 lines
664 B
TypeScript
import observable = require("data/observable");
|
|
import pages = require("ui/page");
|
|
import viewModule = require("ui/core/view");
|
|
import color = require("color");
|
|
|
|
var view: viewModule.View;
|
|
|
|
export function pageLoaded(args: observable.EventData) {
|
|
var page = <pages.Page>args.object;
|
|
view = page.getViewById<viewModule.View>("view");
|
|
}
|
|
|
|
export function onAnimate(args: observable.EventData) {
|
|
view.backgroundColor = new color.Color("Green");
|
|
view.animate({
|
|
backgroundColor: new color.Color("Blue"),
|
|
duration: 2500
|
|
});
|
|
}
|
|
|
|
export function onReset(args: observable.EventData) {
|
|
view.backgroundColor = new color.Color("White");
|
|
} |