当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript Property.register方法代码示例

本文整理汇总了TypeScript中tns-core-modules/ui/core/view.Property.register方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Property.register方法的具体用法?TypeScript Property.register怎么用?TypeScript Property.register使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tns-core-modules/ui/core/view.Property的用法示例。


在下文中一共展示了Property.register方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: function

      return v;
    },
    affectsLayout: true
  }),
  stretchProperty = new Property<WebImageCommon, string>({
    name: "stretch",
    defaultValue: stretchMap.get('none'),
    valueConverter: function(v) {
      return v;
    },
    affectsLayout: true
  });

srcProperty.register(WebImageCommon);
isLoadingProperty.register(WebImageCommon);
roundedProperty.register(WebImageCommon);
placeholderStretchProperty.register(WebImageCommon);
stretchProperty.register(WebImageCommon);
placeholderProperty.register(WebImageCommon);

export class WebImage extends WebImageCommon {

  public rounded: boolean;
  public placeholder: string;
  public placeholderStretch: string;

  constructor() {
    super();
  }

  public get android(): any {
开发者ID:VideoSpike,项目名称:nativescript-web-image-cache,代码行数:31,代码来源:web-image-cache.android.ts

示例2: constructor

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

export class GifCommon extends View {
  public src: string;

  constructor() {
    super();
  }
}

export const srcProperty = new Property<GifCommon, string>({
  name: 'src',
  defaultValue: ''
});
srcProperty.register(GifCommon);

export const headersProperty = new Property<GifCommon, any>({
  name: 'headers'
});
headersProperty.register(GifCommon);

export const isLoadingProperty = new Property<GifCommon, boolean>({
  name: 'isLoading',
  defaultValue: false
});
isLoadingProperty.register(GifCommon);
开发者ID:bradmartin,项目名称:nativescript-gif,代码行数:26,代码来源:gif.common.ts

示例3:

export const imageUriProperty = new Property<ImageCacheItBase, any>({
    name: 'imageUri'
});
export const placeHolderProperty = new Property<ImageCacheItBase, string>({
    name: 'placeHolder'
});
export const errorHolderProperty = new Property<ImageCacheItBase, string>({
    name: 'errorHolder'
});
export const resizeProperty = new Property<ImageCacheItBase, string>({
    name: 'resize'
});
export const stretchProperty = new Property<ImageCacheItBase, Stretch>({
    name: 'stretch'
});

export class ImageCacheItBase extends View {
    public imageUri: any;
    public placeHolder: string;
    public errorHolder: string;
    public resize: string;
    public stretch: Stretch;
}

export type Stretch = 'none' | 'fill' | 'aspectFill' | 'aspectFit';
imageUriProperty.register(ImageCacheItBase);
placeHolderProperty.register(ImageCacheItBase);
errorHolderProperty.register(ImageCacheItBase);
resizeProperty.register(ImageCacheItBase);
stretchProperty.register(ImageCacheItBase);
开发者ID:triniwiz,项目名称:nativescript-image-cache-it,代码行数:30,代码来源:image-cache-it.common.ts

示例4:

}
export const fillProperty = new Property<AdvancedVideoViewBase, boolean>({
    name: 'fill',
    defaultValue: false
});
export const thumbnailCountProperty = new Property<AdvancedVideoViewBase, number>({
    name: 'thumbnailCount',
    defaultValue: 1
});
export const qualityProperty = new Property<AdvancedVideoViewBase, any>({
    name: 'quality',
    defaultValue: Quality.MAX_480P
});
export const cameraPositionProperty = new Property<AdvancedVideoViewBase,
    CameraPositionType>({
        name: 'cameraPosition',
        defaultValue: 'back'
    });

export const saveToGalleryProperty = new Property<AdvancedVideoViewBase,
    boolean>({
        name: 'saveToGallery',
        defaultValue: false
    });

qualityProperty.register(AdvancedVideoViewBase);
cameraPositionProperty.register(AdvancedVideoViewBase);
saveToGalleryProperty.register(AdvancedVideoViewBase);
fillProperty.register(AdvancedVideoViewBase);
thumbnailCountProperty.register(AdvancedVideoViewBase);
开发者ID:triniwiz,项目名称:nativescript-videorecorder,代码行数:30,代码来源:advanced-video-view.common.ts

示例5: if

      default:
        return false;
    }
  } else if (types.isBoolean(value)) {
    return value;
  }
  return false;
}
export const srcProperty = new Property<TNSPSPDFView, string>({
  name: 'src'
});

export const documentTitleProperty = new Property<TNSPSPDFView, string>({
  name: 'documentTitle'
});

export const selectedIndexProperty = new Property<TNSPSPDFView, number>({
  name: 'selectedIndex',
  defaultValue: 0
});
export class TNSPSPDFView extends View {
  src: string;
  progress: number;
  documentTitle: string;
  selectedIndex: number;
}

srcProperty.register(TNSPSPDFView);
documentTitleProperty.register(TNSPSPDFView);
selectedIndexProperty.register(TNSPSPDFView);
开发者ID:sean-perkins,项目名称:nativescript-pspdfkit,代码行数:30,代码来源:common.ts

示例6: fromNativeSource

}

export function fromNativeSource(source: any): definition.ImageSourceSVG {
    var image = new definition.ImageSourceSVG();
    return image.setNativeSource(source) ? image : null;
}

export function fromUrl(url: string): definition.ImageSourceSVG {
    var image = new definition.ImageSourceSVG();
    return image.loadFromUrl(url) ? image : null;
}

export function fromFileOrResource(path: string): definition.ImageSourceSVG {
    if (!isFileOrResourcePath(path)) {
        throw new Error("Path \"" + "\" is not a valid file or resource.");
    }

    if (path.indexOf(utils.RESOURCE_PREFIX) === 0) {
        return fromResource(path.substr(utils.RESOURCE_PREFIX.length));
    }
    return fromFile(path);
}

export function isFileOrResourcePath(path: string): boolean {
    return utils.isFileOrResourcePath(path);
}

srcProperty.register(SVGImage);
imageSourceProperty.register(SVGImage);
loadModeProperty.register(SVGImage);
isLoadingProperty.register(SVGImage);
开发者ID:peoplewareDo,项目名称:nativescript-svg,代码行数:31,代码来源:svg.common.ts


注:本文中的tns-core-modules/ui/core/view.Property.register方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。