• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript view.Property类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: function

/// <reference path="./and-ts-lib/types.d.ts" />

import { WebImageCommon, srcProperty, isLoadingProperty } from './web-image-cache.common';
import { StretchMapping as stretchMap } from './and-ts-lib/stretch-mapping';
import { Helpers as helpers } from './and-ts-lib/helpers';

import * as application from 'tns-core-modules/application';
import * as appSettings from 'tns-core-modules/application-settings';
import { Property, booleanConverter } from 'tns-core-modules/ui/core/view';

let roundedProperty = new Property<WebImageCommon, boolean>({
  name: "rounded",
  defaultValue: false,
  valueConverter: booleanConverter,
  affectsLayout: true
}),
  placeholderProperty = new Property<WebImageCommon, string>({
    name: "placeholder",
    defaultValue: undefined,
    valueConverter: function(v) {
      return v;
    },
    affectsLayout: true
  }),
  placeholderStretchProperty = new Property<WebImageCommon, string>({
    name: "placeholderStretch",
    defaultValue: stretchMap.get('none'),
    valueConverter: function(v) {
      return v;
    },
    affectsLayout: true
开发者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:

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

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);
开发者ID:triniwiz,项目名称:nativescript-image-cache-it,代码行数:31,代码来源:image-cache-it.common.ts


示例4: isAvailable

    cameraPosition: CameraPositionType;
    saveToGallery: boolean;
    quality: Quality;
    thumbnailCount: number;
    fill: boolean;

    public static isAvailable(): boolean {
        return false;
    }

    public static requestPermissions(explanation?: string): Promise<any> {
        return Promise.resolve();
    }
}
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'
    });
开发者ID:triniwiz,项目名称:nativescript-videorecorder,代码行数:31,代码来源:advanced-video-view.common.ts


示例5: boolParse

export function boolParse(value: any) {
  if (types.isString(value)) {
    switch (value.toLowerCase()) {
      case 'yes':
        return true;
      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;
开发者ID:sean-perkins,项目名称:nativescript-pspdfkit,代码行数:30,代码来源:common.ts


示例6: constructor

import { View, Property } from "tns-core-modules/ui/core/view";
import * as utils from "tns-core-modules/utils/utils";
import * as types from "tns-core-modules/utils/types"

// This is used for definition purposes only, it does not generate JavaScript for it.
import * as definition from "./svg";

var SRC = "src";
var IMAGE_SOURCE = "imageSource";
var LOAD_MODE = "loadMode";
var SYNC = "sync";
var ASYNC = "async";
var ISLOADING = "isLoading";

export const srcProperty = new Property<SVGImage, boolean>({ name: SRC, defaultValue: undefined, valueChanged: (target, oldValue, newValue) => target._createImageSourceFromSrc() });
export const imageSourceProperty = new Property<SVGImage, definition.ImageSourceSVG>({ name: IMAGE_SOURCE, defaultValue: undefined });
export const isLoadingProperty = new Property<SVGImage, boolean>({ name: ISLOADING, defaultValue: false });
export const loadModeProperty = new Property<SVGImage, string>({ name: LOAD_MODE, defaultValue: SYNC });

export class SVGImage extends View implements definition.SVGImage {
    src: any;
    imageSource: definition.ImageSourceSVG;
    isLoading: boolean;
    loadMode: "sync" | "async";

    constructor(options?: definition.Options) {
        // super(options);
        super();
    }

    /**
开发者ID:peoplewareDo,项目名称:nativescript-svg,代码行数:31,代码来源:svg.common.ts



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript dialogs.action函数代码示例发布时间:2022-05-25
下一篇:
TypeScript button.Button类代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap