-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import * as application from 'application'; | ||
application.start({ moduleName: "main-page" }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import * as observable from 'data/observable'; | ||
import * as pages from 'ui/page'; | ||
import {HelloWorldModel} from './main-view-model'; | ||
import { EventData } from 'data/observable'; | ||
import { Page } from 'ui/page'; | ||
import { isAndroid, device } from "platform"; | ||
import { Color } from "color"; | ||
import { android } from "application"; | ||
// Event handler for Page 'loaded' event attached in main-page.xml | ||
export function pageLoaded(args: observable.EventData) { | ||
// Get the event sender | ||
let page = <pages.Page>args.object; | ||
page.bindingContext = new HelloWorldModel(page); | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import {Observable} from 'data/observable'; | ||
import {AndroidIosSwitch} from 'nativescript-android-iosswitch'; | ||
import { Page } from 'ui/page'; | ||
export class HelloWorldModel extends Observable { | ||
|
||
public message: string; | ||
private npb: AndroidIosSwitch; | ||
constructor(mainPage: Page) { | ||
super(); | ||
// this.npb = new NumberProgressBar(); | ||
this.npb = <AndroidIosSwitch>mainPage.getViewById('sb'); | ||
|
||
} | ||
public onTrue() { | ||
this.npb.toggleSwitch(true); | ||
} | ||
public onFalse() { | ||
this.npb.setChecked(false); | ||
} | ||
} | ||
|