mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 04:41:36 +08:00

recycleNativeView filed now accepts: "always" | "never" | "auto". Always will recycle the nativeView no matter if its nativeView or android proprties are accessed. Never will disable recycling. Auto will recycle it only if nativeView and android properties are not accessed.
13 lines
476 B
TypeScript
13 lines
476 B
TypeScript
import { Switch as SwitchDefinition } from ".";
|
|
import { View, Property, booleanConverter } from "../core/view";
|
|
|
|
export * from "../core/view";
|
|
|
|
export class SwitchBase extends View implements SwitchDefinition {
|
|
public checked: boolean;
|
|
}
|
|
|
|
SwitchBase.prototype.recycleNativeView = "auto";
|
|
|
|
export const checkedProperty = new Property<SwitchBase, boolean>({ name: "checked", defaultValue: false, valueConverter: booleanConverter });
|
|
checkedProperty.register(SwitchBase); |