mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
18 lines
720 B
TypeScript
18 lines
720 B
TypeScript
import { Placeholder as PlaceholderDefinition, CreateViewEventData } from ".";
|
|
import { View, EventData, CSSType } from "../core/view";
|
|
|
|
@CSSType("Placeholder")
|
|
export class Placeholder extends View implements PlaceholderDefinition {
|
|
public static creatingViewEvent = "creatingView";
|
|
|
|
public createNativeView() {
|
|
const args = <CreateViewEventData>{ eventName: Placeholder.creatingViewEvent, object: this, view: undefined, context: this._context };
|
|
this.notify(args);
|
|
|
|
return <android.view.View>args.view;
|
|
}
|
|
}
|
|
export interface Placeholder {
|
|
on(eventNames: string, callback: (args: EventData) => void);
|
|
on(event: "creatingView", callback: (args: CreateViewEventData) => void);
|
|
} |