mirror of
				https://github.com/NativeScript/NativeScript.git
				synced 2025-11-04 04:18:52 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			27 lines
		
	
	
		
			772 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
		
			772 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
import { CreateViewEventData } from './placeholder-common';
 | 
						|
import { View, CSSType } from '../core/view';
 | 
						|
import { EventData } from '../../data/observable';
 | 
						|
 | 
						|
export * from './placeholder-common';
 | 
						|
 | 
						|
@CSSType('Placeholder')
 | 
						|
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 <android.view.View>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;
 | 
						|
}
 |