Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions packages/core/ui/frame/frame-common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { sanitizeModuleName } from '../../utils/common';
import { profile } from '../../profiling';
import { FRAME_SYMBOL } from './frame-helpers';
import { SharedTransition } from '../transition/shared-transition';
import { NavigationData } from '.';

export { NavigationType } from './frame-interfaces';
export type { AndroidActivityCallbacks, AndroidFragmentCallbacks, AndroidFrame, BackstackEntry, NavigationContext, NavigationEntry, NavigationTransition, TransitionState, ViewEntry, iOSFrame } from './frame-interfaces';
Expand Down Expand Up @@ -256,6 +257,7 @@ export class FrameBase extends CustomLayoutView {
}

public setCurrent(entry: BackstackEntry, navigationType: NavigationType): void {
const fromEntry = this._currentEntry;
const newPage = entry.resolvedPage;

// In case we navigated forward to a page that was in the backstack
Expand All @@ -274,11 +276,12 @@ export class FrameBase extends CustomLayoutView {
}

newPage.onNavigatedTo(isBack);
this.notify({
this.notify<NavigationData>({
eventName: FrameBase.navigatedToEvent,
object: this,
isBack,
entry,
fromEntry,
});

// Reset executing context after NavigatedTo is raised;
Expand Down Expand Up @@ -478,7 +481,7 @@ export class FrameBase extends CustomLayoutView {
}

backstackEntry.resolvedPage.onNavigatingTo(backstackEntry.entry.context, isBack, backstackEntry.entry.bindingContext);
this.notify({
this.notify<NavigationData>({
eventName: FrameBase.navigatingToEvent,
object: this,
isBack,
Expand Down
4 changes: 2 additions & 2 deletions packages/core/ui/frame/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { Transition } from '../transition';
export * from './frame-interfaces';

export interface NavigationData extends EventData {
entry?: NavigationEntry;
fromEntry?: NavigationEntry;
entry?: BackstackEntry;
fromEntry?: BackstackEntry;
isBack?: boolean;
}

Expand Down
Loading