How to use the tns-core-modules/ui/core/properties.Property function in tns-core-modules

To help you get started, we’ve selected a few tns-core-modules examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github NativeScript / NativeScript / tests / app / xml-declaration / template-builder-tests / template-view.ts View on Github external
export module knownTemplates {
    export var template = "template";
}

export class TemplateView extends LayoutBase {
    public template: string;

    public static testEvent: string = "test";

    public parseTemplate() {
        this.addChild(parse(this.template));
    }
}

export const templateProperty = new Property({
    name: "template",
    affectsLayout: true
});
templateProperty.register(TemplateView);
github EddyVerbruggen / nativescript-plugin-firebase / src / mlkit / automl / automl-common.ts View on Github external
import { Property } from "tns-core-modules/ui/core/properties";
import { MLKitCameraView } from "../mlkit-cameraview";

export const localModelResourceFolderProperty = new Property({
  name: "localModelResourceFolder",
  defaultValue: null,
});

export const confidenceThresholdProperty = new Property({
  name: "confidenceThreshold",
  defaultValue: 0.5,
});

export abstract class MLKitAutoML extends MLKitCameraView {
  static scanResultEvent: string = "scanResult";

  protected localModelResourceFolder: string;
  protected confidenceThreshold: number;
github rhanb / nativescript-bottombar / src / common.ts View on Github external
itemsProperty.register(BottomBarBase);



export const selectedIndexProperty = new Property ({
    name : "selectedIndex",
    defaultValue : 0,
    valueConverter : value => +value
});

selectedIndexProperty.register(BottomBarBase);



export const titleStateProperty = new Property ({
    name : "titleState"
});

titleStateProperty.register(BottomBarBase);



export const hideProperty = new Property ({
    name : "hide",
    valueConverter : value => Boolean(value)
});

hideProperty.register(BottomBarBase);
github rkhayyat / nativescript-swipe-card / swipe-card.common.ts View on Github external
itemsProperty.register(SwipeCardBase);

export const heightProperty = new Property({
    name: "cardHeight",
    equalityComparer: (a: any[], b: any[]) => !a && !b && a.length === b.length
});
heightProperty.register(SwipeCardBase);

export const widthProperty = new Property({
    name: "cardWidth",
    equalityComparer: (a: any[], b: any[]) => !a && !b && a.length === b.length
});

widthProperty.register(SwipeCardBase);

export const borderRadiusProperty = new Property({
    name: "cardBorderRadius",
    equalityComparer: (a: any[], b: any[]) => !a && !b && a.length === b.length
});

borderRadiusProperty.register(SwipeCardBase);

export const borderWidthProperty = new Property({
    name: "cardBorderWidth",
    equalityComparer: (a: any[], b: any[]) => !a && !b && a.length === b.length
});

borderWidthProperty.register(SwipeCardBase);

export const randomColorProperty = new Property({
    name: "isRandomColor",
    equalityComparer: (a: any[], b: any[]) => !a && !b && a.length === b.length
github charsleysa / nativescript-mdc / src / components / floatingActionButton / floatingActionButton-common.ts View on Github external
this.imageSource = fromNativeSource(value);
            this.isLoading = false;
        }
    }
}

export const fabSizeProperty = new Property({ name: 'fabSize', defaultValue: 'normal' });
fabSizeProperty.register(FloatingActionButtonBase);

export const imageSourceProperty = new Property({ name: 'imageSource' });
imageSourceProperty.register(FloatingActionButtonBase);

export const iconProperty = new Property({ name: 'icon' });
iconProperty.register(FloatingActionButtonBase);

export const isLoadingProperty = new Property({ name: 'isLoading', defaultValue: false, valueConverter: booleanConverter });
isLoadingProperty.register(FloatingActionButtonBase);
github bradmartin / nativescript-lottie / src / nativescript-lottie.common.ts View on Github external
* Licensed under the MIT license.
 *
 * Version 1.0.0                                           walkerrunpdx@gmail.com
 **********************************************************************************/

import { Property } from 'tns-core-modules/ui/core/properties';
import { booleanConverter, View } from 'tns-core-modules/ui/core/view';

export class LottieViewBase extends View {
  public src: string;
  public loop: boolean;
  public autoPlay: boolean;
  public completionBlock: (animationFinished: boolean) => void;
}

export const srcProperty = new Property({
  name: 'src'
});

srcProperty.register(LottieViewBase);

export const loopProperty = new Property({
  name: 'loop',
  defaultValue: false,
  valueConverter: booleanConverter
});

loopProperty.register(LottieViewBase);

export const autoPlayProperty = new Property({
  name: 'autoPlay',
  defaultValue: false,
github EddyVerbruggen / nativescript-plugin-firebase / src / mlkit / mlkit-cameraview-common.ts View on Github external
import { ContentView } from "tns-core-modules/ui/content-view";
import { Property } from "tns-core-modules/ui/core/properties";
import { booleanConverter } from "tns-core-modules/ui/core/view-base";

export const processEveryNthFrameProperty = new Property({
  name: "processEveryNthFrame",
  defaultValue: 10,
});

export const preferFrontCameraProperty = new Property({
  name: "preferFrontCamera",
  defaultValue: false,
  valueConverter: booleanConverter
});

export const torchOnProperty = new Property({
  name: "torchOn",
  defaultValue: false,
  valueConverter: booleanConverter
});

export const pauseProperty = new Property({
  name: "pause",
  defaultValue: false,
  valueConverter: booleanConverter
});
github EddyVerbruggen / nativescript-plugin-firebase / src / mlkit / barcodescanning / barcodescanning-common.ts View on Github external
EAN_13 = 32,
  EAN_8 = 64,
  ITF = 128,
  QR_CODE = 256,
  UPC_A = 512,
  UPC_E = 1024,
  PDF417 = 2048,
  AZTEC = 4096,
}

export const formatsProperty = new Property({
  name: "formats",
  defaultValue: null,
});

export const beepOnScanProperty = new Property({
  name: "beepOnScan",
  defaultValue: true,
  valueConverter: booleanConverter
});

export const reportDuplicatesProperty = new Property({
  name: "reportDuplicates",
  defaultValue: false,
  valueConverter: booleanConverter
});

export abstract class MLKitBarcodeScanner extends MLKitCameraView {
  protected formats: string;
  protected beepOnScan: boolean;
  protected reportDuplicates: boolean;
github bradmartin / nativescript-lottie / src / nativescript-lottie.common.ts View on Github external
import { booleanConverter, View } from 'tns-core-modules/ui/core/view';

export class LottieViewBase extends View {
  public src: string;
  public loop: boolean;
  public autoPlay: boolean;
  public completionBlock: (animationFinished: boolean) => void;
}

export const srcProperty = new Property({
  name: 'src'
});

srcProperty.register(LottieViewBase);

export const loopProperty = new Property({
  name: 'loop',
  defaultValue: false,
  valueConverter: booleanConverter
});

loopProperty.register(LottieViewBase);

export const autoPlayProperty = new Property({
  name: 'autoPlay',
  defaultValue: false,
  valueConverter: booleanConverter
});

autoPlayProperty.register(LottieViewBase);
github charsleysa / nativescript-mdc / src / components / floatingActionButton / floatingActionButton-common.ts View on Github external
} else if (value instanceof ImageAsset) {
            fromAsset(value).then((result) => {
                this.imageSource = result;
                this.isLoading = false;
            });
        } else {
            this.imageSource = fromNativeSource(value);
            this.isLoading = false;
        }
    }
}

export const fabSizeProperty = new Property({ name: 'fabSize', defaultValue: 'normal' });
fabSizeProperty.register(FloatingActionButtonBase);

export const imageSourceProperty = new Property({ name: 'imageSource' });
imageSourceProperty.register(FloatingActionButtonBase);

export const iconProperty = new Property({ name: 'icon' });
iconProperty.register(FloatingActionButtonBase);

export const isLoadingProperty = new Property({ name: 'isLoading', defaultValue: false, valueConverter: booleanConverter });
isLoadingProperty.register(FloatingActionButtonBase);