Files
2017-03-28 18:08:59 +03:00

23 lines
774 B
TypeScript

import { StackLayout as StackLayoutDefinition } from ".";
import { LayoutBase, Property, isIOS } from "../layout-base";
export * from "../layout-base";
export class StackLayoutBase extends LayoutBase implements StackLayoutDefinition {
public orientation: "horizontal" | "vertical";
}
StackLayoutBase.prototype.recycleNativeView = true;
export const orientationProperty = new Property<StackLayoutBase, "horizontal" | "vertical">({
name: "orientation", defaultValue: "vertical", affectsLayout: isIOS,
valueConverter: (v) => {
if (v === "horizontal" || v === "vertical") {
return <"horizontal" | "vertical">v;
}
throw new Error(`Invalid orientation value: ${v}`);
}
});
orientationProperty.register(StackLayoutBase);