mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-18 13:51:27 +08:00
58 lines
1.8 KiB
TypeScript
58 lines
1.8 KiB
TypeScript
import * as application from "tns-core-modules/application";
|
|
import { EventData } from "tns-core-modules/ui/core/view";
|
|
import { Button } from "tns-core-modules/ui/button";
|
|
|
|
export function onNavigateToLayoutFrame(args: EventData) {
|
|
application._resetRootView({ moduleName: "layout-root/layout-frame-root" });
|
|
}
|
|
|
|
export function onNavigateToLayoutMultiFrame(args: EventData) {
|
|
application._resetRootView({ moduleName: "layout-root/layout-multi-frame-root" });
|
|
}
|
|
|
|
export function onNavigateToPageFrame(args: EventData) {
|
|
const button = <Button>args.object;
|
|
button.page.frame.navigate("frame-root/frame-home-page");
|
|
}
|
|
|
|
export function onNavigateToPageMultiFrame(args: EventData) {
|
|
const button = <Button>args.object;
|
|
button.page.frame.navigate("frame-root/frame-multi-home-page");
|
|
}
|
|
|
|
export function onNavigateToTabsTopPage(args: EventData) {
|
|
const button = <Button>args.object;
|
|
button.page.frame.navigate("tab-page/tabs-top-page");
|
|
}
|
|
|
|
export function onNavigateToTabsBottomPage(args: EventData) {
|
|
const button = <Button>args.object;
|
|
button.page.frame.navigate("tab-page/tabs-bottom-page");
|
|
}
|
|
|
|
export function onNavigateToTabsTopRoot(args: EventData) {
|
|
application._resetRootView({ moduleName: "tab-root/tab-top-root" });
|
|
}
|
|
|
|
export function onNavigateToTabsBottomRoot(args: EventData) {
|
|
application._resetRootView({ moduleName: "tab-root/tab-bottom-root" });
|
|
}
|
|
|
|
export function onNavigateToSomePage(args: EventData) {
|
|
const button = <Button>args.object;
|
|
button.page.frame.navigate("some-page/some-page");
|
|
}
|
|
|
|
export function onFrameToNestedFrame(args: EventData) {
|
|
const button = <Button>args.object;
|
|
button.page.frame.navigate({
|
|
moduleName: "frame-root/frame-home-page",
|
|
animated: true,
|
|
transition: {
|
|
name: "slide",
|
|
duration: 300,
|
|
curve: "easeIn"
|
|
}
|
|
});
|
|
}
|