mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-15 11:01:21 +08:00
26 lines
720 B
TypeScript
26 lines
720 B
TypeScript
import { View } from '../core/view';
|
|
import { CreateViewEventData } from './placeholder-common';
|
|
import { EventData } from '../../data/observable';
|
|
|
|
export * from './placeholder-common';
|
|
|
|
export class Placeholder extends View {
|
|
public static creatingViewEvent = 'creatingView';
|
|
|
|
public createNativeView() {
|
|
const args = <CreateViewEventData>{
|
|
eventName: Placeholder.creatingViewEvent,
|
|
object: this,
|
|
view: undefined,
|
|
context: this._context,
|
|
};
|
|
this.notify(args);
|
|
|
|
return args.view;
|
|
}
|
|
}
|
|
export interface Placeholder {
|
|
on(eventNames: string, callback: (args: EventData) => void, thisArg?: any): void;
|
|
on(event: 'creatingView', callback: (args: CreateViewEventData) => void, thisArg?: any): void;
|
|
}
|