diff --git a/CrossPlatformModules.csproj b/CrossPlatformModules.csproj
index 1f8bb0a24..4f26631e7 100644
--- a/CrossPlatformModules.csproj
+++ b/CrossPlatformModules.csproj
@@ -369,7 +369,9 @@
-
+
+ button.xml
+
webview.xml
@@ -795,7 +797,6 @@
-
utils.d.ts
@@ -1379,7 +1380,9 @@
styling.d.ts
-
+
+ style-property.d.ts
+
@@ -1947,7 +1950,7 @@
False
-
+
\ No newline at end of file
diff --git a/apps/tests/pages/fonts-test.ts b/apps/tests/pages/fonts-test.ts
index 7b5b18e8b..14d5ba0ba 100644
--- a/apps/tests/pages/fonts-test.ts
+++ b/apps/tests/pages/fonts-test.ts
@@ -10,7 +10,6 @@ export function buttonTap(args) {
v.style._resetValue(style.fontSizeProperty);
v.style._resetValue(style.fontStyleProperty);
v.style._resetValue(style.fontWeightProperty);
- v.style._resetValue(style.fontProperty);
v.style._resetValue(style.colorProperty);
v.style._resetValue(style.textAlignmentProperty);
diff --git a/apps/tests/ui/scroll-view/scroll-view-tests.ts b/apps/tests/ui/scroll-view/scroll-view-tests.ts
index 26ffbf786..fa84a5865 100644
--- a/apps/tests/ui/scroll-view/scroll-view-tests.ts
+++ b/apps/tests/ui/scroll-view/scroll-view-tests.ts
@@ -124,7 +124,7 @@ export function test_scrollabeHeight_vertical_orientation_when_content_is_big()
scrollView.content = btn;
waitForLayout();
- TKUnit.assertEqual(scrollView.scrollableHeight, 200, "scrollView.scrollableHeight");
+ TKUnit.assertAreClose(scrollView.scrollableHeight, 200, 0.4, "scrollView.scrollableHeight");
TKUnit.assertEqual(scrollView.scrollableWidth, 0, "scrollView.scrollableWidth");
}
@@ -157,7 +157,7 @@ export function test_scrollabeWidth_horizontal_orientation_when_content_is_big()
waitForLayout();
TKUnit.assertEqual(scrollView.scrollableHeight, 0, "scrollView.scrollableHeight");
- TKUnit.assertEqual(scrollView.scrollableWidth, 300, "scrollView.scrollableWidth");
+ TKUnit.assertAreClose(scrollView.scrollableWidth, 300, 0.4, "scrollView.scrollableWidth");
}
export function test_scrollToVerticalOffset_no_animation() {
@@ -174,7 +174,7 @@ export function test_scrollToVerticalOffset_no_animation() {
TKUnit.assertEqual(scrollView.verticalOffset, 0, "scrollView.verticalOffset");
scrollView.scrollToVerticalOffset(100, false);
- TKUnit.assertEqual(scrollView.verticalOffset, 100, "scrollView.verticalOffset");
+ TKUnit.assertAreClose(scrollView.verticalOffset, 100, 0.1, "scrollView.verticalOffset");
}
export function test_scrollToVerticalOffset_with_animation() {
@@ -198,7 +198,7 @@ export function test_scrollToVerticalOffset_with_animation() {
TKUnit.waitUntilReady(() => { return scrollView.verticalOffset === 100 }, ASYNC);
// The scrolling animation should be finished by now
- TKUnit.assertEqual(scrollView.verticalOffset, 100, "scrollView.verticalOffset");
+ TKUnit.assertAreClose(scrollView.verticalOffset, 100, 0.1, "scrollView.verticalOffset");
}
export function test_scrollToHorizontalOffset_no_animation() {
@@ -215,7 +215,7 @@ export function test_scrollToHorizontalOffset_no_animation() {
TKUnit.assertEqual(scrollView.horizontalOffset, 0, "scrollView.horizontalOffset");
scrollView.scrollToHorizontalOffset(100, false);
- TKUnit.assertEqual(scrollView.horizontalOffset, 100, "scrollView.horizontalOffset");
+ TKUnit.assertAreClose(scrollView.horizontalOffset, 100, 0.1, "scrollView.horizontalOffset");
}
export function test_scrollToHorizontalOffset_with_animation() {
@@ -239,7 +239,7 @@ export function test_scrollToHorizontalOffset_with_animation() {
TKUnit.waitUntilReady(() => { return scrollView.horizontalOffset === 100 }, ASYNC);
// The scrolling animation should be finished by now
- TKUnit.assertEqual(scrollView.horizontalOffset, 100, "scrollView.horizontalOffset");
+ TKUnit.assertAreClose(scrollView.horizontalOffset, 100, 0.1, "scrollView.horizontalOffset");
}
export function test_scrollView_persistsState_vertical() {
@@ -256,7 +256,7 @@ export function test_scrollView_persistsState_vertical() {
scrollView.scrollToVerticalOffset(100, false);
- TKUnit.assertEqual(scrollView.verticalOffset, 100, "scrollView.verticalOffset before navigation");
+ TKUnit.assertAreClose(scrollView.verticalOffset, 100, 0.1, "scrollView.verticalOffset before navigation");
helper.do_PageTest_WithButton((t) => {
// Just navigate forward and back.
@@ -264,11 +264,11 @@ export function test_scrollView_persistsState_vertical() {
// Wait for the page to reload.
TKUnit.waitUntilReady(function () {
- return scrollView.verticalOffset === 100;
+ return Math.abs(scrollView.verticalOffset - 100) < 0.1;
}, ASYNC);
// Check verticalOffset after navigation
- TKUnit.assertEqual(scrollView.verticalOffset, 100, "scrollView.verticalOffset after navigation");
+ TKUnit.assertAreClose(scrollView.verticalOffset, 100, 0.1, "scrollView.verticalOffset after navigation");
}
export function test_scrollView_persistsState_horizontal() {
@@ -285,7 +285,7 @@ export function test_scrollView_persistsState_horizontal() {
scrollView.scrollToHorizontalOffset(100, false);
- TKUnit.assertEqual(scrollView.horizontalOffset, 100, "scrollView.horizontalOffset before navigation");
+ TKUnit.assertAreClose(scrollView.horizontalOffset, 100, 0.1, "scrollView.horizontalOffset before navigation");
helper.do_PageTest_WithButton((t) => {
// Just navigate forward and back.
@@ -293,9 +293,9 @@ export function test_scrollView_persistsState_horizontal() {
// Wait for the page to reload.
TKUnit.waitUntilReady(function () {
- return scrollView.horizontalOffset === 100;
+ return Math.abs(scrollView.horizontalOffset - 100) < 0.1;
}, ASYNC);
// Check verticalOffset after navigation
- TKUnit.assertEqual(scrollView.horizontalOffset, 100, "scrollView.horizontalOffset after navigation");
+ TKUnit.assertAreClose(scrollView.horizontalOffset, 100, 0.1, "scrollView.horizontalOffset after navigation");
}
diff --git a/apps/tests/ui/search-bar/search-bar-tests.ts b/apps/tests/ui/search-bar/search-bar-tests.ts
index 7164134f5..b030c20a0 100644
--- a/apps/tests/ui/search-bar/search-bar-tests.ts
+++ b/apps/tests/ui/search-bar/search-bar-tests.ts
@@ -70,7 +70,7 @@ export var testSearchBarFontSize = function () {
searchBar.style.fontSize = expectedValue;
actualValue = searchBarTestsNative.getNativeFontSize(searchBar);
- TKUnit.assert(actualValue === expectedValue, "Actual: " + actualValue + "; Expected: " + expectedValue);
+ TKUnit.assertAreClose(actualValue, expectedValue, 0.2);
});
};
diff --git a/apps/tests/ui/view/view-tests-common.ts b/apps/tests/ui/view/view-tests-common.ts
index 74134f0b0..c0fdb2e2c 100644
--- a/apps/tests/ui/view/view-tests-common.ts
+++ b/apps/tests/ui/view/view-tests-common.ts
@@ -407,11 +407,11 @@ function property_binding_test(propName: string, firstValue: any, secondValue: a
view.bind(options, model);
actualResult = view.get(propName);
- TKUnit.assert(actualResult === firstValue, "Actual result: " + actualResult + "; Expected result: " + firstValue);
+ TKUnit.assertEqual(actualResult, firstValue);
model.set(propName, secondValue);
actualResult = view.get(propName);
- TKUnit.assert(actualResult === secondValue, "Actual result: " + actualResult + "; Expected result: " + secondValue);
+ TKUnit.assertEqual(actualResult, secondValue);
}
function property_binding_style_test(propName: string, firstValue: any, secondValue: any, view?: viewModule.View) {
@@ -431,11 +431,11 @@ function property_binding_style_test(propName: string, firstValue: any, secondVa
view.bind(options, model);
actualResult = view.style.get(propName);
- TKUnit.assert(actualResult === firstValue, "Actual result: " + actualResult + "; Expected result: " + firstValue);
+ TKUnit.assertEqual(actualResult, firstValue);
model.set(propName, secondValue);
actualResult = view.style.get(propName);
- TKUnit.assert(actualResult === secondValue, "Actual result: " + actualResult + "; Expected result: " + secondValue);
+ TKUnit.assertEqual(actualResult, secondValue);
}
export var test_binding_width = function () {
@@ -531,7 +531,7 @@ export var test_binding_style_minHeight = function () {
}
export var test_binding_style_margin = function () {
- property_binding_style_test("margin", "1,1,1,1", "2,2,2,2");
+ property_binding_style_test("margin", "1 1 1 1", "2 2 2 2");
}
export var test_binding_style_marginLeft = function () {
@@ -551,7 +551,7 @@ export var test_binding_style_marginBottom = function () {
}
export var test_binding_style_padding = function () {
- property_binding_style_test("padding", "1,1,1,1", "2,2,2,2");
+ property_binding_style_test("padding", "1 1 1 1", "2 2 2 2");
}
export var test_binding_style_paddingLeft = function () {
@@ -600,16 +600,16 @@ export var testIsVisible = function () {
var lbl = new label.Label();
helper.buildUIAndRunTest(lbl, function (views: Array) {
- TKUnit.assert(lbl.visibility === enums.Visibility.visible, "Actual: " + lbl.visibility + "; Expected: " + enums.Visibility.visible);
- TKUnit.assert(lbl._isVisible, "Actual: " + lbl._isVisible + "; Expected: true;");
+ TKUnit.assertEqual(lbl.visibility, enums.Visibility.visible);
+ TKUnit.assertEqual(lbl._isVisible, true);
lbl.visibility = enums.Visibility.collapse;
- TKUnit.assert(lbl.visibility === enums.Visibility.collapse, "Actual: " + lbl.visibility + "; Expected: " + enums.Visibility.collapse);
- TKUnit.assert(!lbl._isVisible, "Actual: " + lbl._isVisible + "; Expected: false;");
+ TKUnit.assertEqual(lbl.visibility, enums.Visibility.collapse);
+ TKUnit.assertEqual(lbl._isVisible, false);
lbl.visibility = enums.Visibility.collapsed;
- TKUnit.assert(lbl.visibility === enums.Visibility.collapsed, "Actual: " + lbl.visibility + "; Expected: " + enums.Visibility.collapsed);
- TKUnit.assert(!lbl._isVisible, "Actual: " + lbl._isVisible + "; Expected: false;");
+ TKUnit.assertEqual(lbl.visibility, enums.Visibility.collapsed);
+ TKUnit.assertEqual(lbl._isVisible, false);
});
}
@@ -632,7 +632,7 @@ export var testBorderWidth = function () {
var lbl = views[0];
var expectedValue = lbl.borderWidth;
var actualValue = definition.getNativeBorderWidth(lbl);
- TKUnit.assert(actualValue === expectedValue, "Actual: " + actualValue + "; Expected: " + expectedValue);
+ TKUnit.assertEqual(actualValue, expectedValue);
});
}
@@ -641,21 +641,21 @@ export var testCornerRadius = function () {
var lbl = views[0];
var expectedValue = lbl.borderRadius;
var actualValue = definition.getNativeCornerRadius(lbl);
- TKUnit.assert(actualValue === expectedValue, "Actual: " + actualValue + "; Expected: " + expectedValue);
+ TKUnit.assertEqual(actualValue, expectedValue);
});
}
export var testBorderColor = function () {
helper.buildUIAndRunTest(_createLabelWithBorder(), function (views: Array) {
var lbl = views[0];
- TKUnit.assert(definition.checkNativeBorderColor(lbl), "BorderColor not applied correctly!");
+ TKUnit.assertEqual(definition.checkNativeBorderColor(lbl), true, "BorderColor not applied correctly!");
});
}
export var testBackgroundColor = function () {
helper.buildUIAndRunTest(_createLabelWithBorder(), function (views: Array) {
var lbl = views[0];
- TKUnit.assert(definition.checkNativeBackgroundColor(lbl), "BackgroundColor not applied correctly!");
+ TKUnit.assertEqual(definition.checkNativeBackgroundColor(lbl), true, "BackgroundColor not applied correctly!");
});
}
@@ -665,7 +665,6 @@ export var testBackgroundImage = function () {
helper.buildUIAndRunTest(lbl, function (views: Array) {
var page = views[1];
page.css = ".myClass { background-image: url('~/logo.png') }";
-
- TKUnit.assert(definition.checkNativeBackgroundImage(lbl), "Style background-image not loaded correctly.");
+ TKUnit.assertEqual(definition.checkNativeBackgroundImage(lbl), true, "Style background-image not loaded correctly.");
});
}
\ No newline at end of file
diff --git a/apps/ui-tests-app/pages/text/button.ts b/apps/ui-tests-app/pages/text/button.ts
index 0c4b3bb79..c9c0d1c17 100644
--- a/apps/ui-tests-app/pages/text/button.ts
+++ b/apps/ui-tests-app/pages/text/button.ts
@@ -8,9 +8,15 @@ export function resetStyles(args) {
v.style._resetValue(style.fontSizeProperty);
v.style._resetValue(style.fontStyleProperty);
v.style._resetValue(style.fontWeightProperty);
- v.style._resetValue(style.fontProperty);
v.style._resetValue(style.colorProperty);
v.style._resetValue(style.textAlignmentProperty);
+ v.style._resetValue(style.paddingLeftProperty);
+ v.style._resetValue(style.paddingRightProperty);
+ v.style._resetValue(style.paddingTopProperty);
+ v.style._resetValue(style.paddingBottomProperty);
+ v.style._resetValue(style.borderColorProperty);
+ v.style._resetValue(style.borderWidthProperty);
+ v.style._resetValue(style.borderRadiusProperty);
return true;
});
}
diff --git a/apps/ui-tests-app/pages/text/button.xml b/apps/ui-tests-app/pages/text/button.xml
index d15d8ef6d..a056790e1 100644
--- a/apps/ui-tests-app/pages/text/button.xml
+++ b/apps/ui-tests-app/pages/text/button.xml
@@ -8,17 +8,19 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
+
+
+
+
\ No newline at end of file
diff --git a/apps/ui-tests-app/pages/text/label.ts b/apps/ui-tests-app/pages/text/label.ts
index 23bdf67b3..a76943977 100644
--- a/apps/ui-tests-app/pages/text/label.ts
+++ b/apps/ui-tests-app/pages/text/label.ts
@@ -8,7 +8,6 @@ export function resetStyles(args) {
v.style._resetValue(style.fontSizeProperty);
v.style._resetValue(style.fontStyleProperty);
v.style._resetValue(style.fontWeightProperty);
- v.style._resetValue(style.fontProperty);
v.style._resetValue(style.colorProperty);
v.style._resetValue(style.textAlignmentProperty);
return true;
diff --git a/apps/ui-tests-app/pages/text/text-field.ts b/apps/ui-tests-app/pages/text/text-field.ts
index 23bdf67b3..a76943977 100644
--- a/apps/ui-tests-app/pages/text/text-field.ts
+++ b/apps/ui-tests-app/pages/text/text-field.ts
@@ -8,7 +8,6 @@ export function resetStyles(args) {
v.style._resetValue(style.fontSizeProperty);
v.style._resetValue(style.fontStyleProperty);
v.style._resetValue(style.fontWeightProperty);
- v.style._resetValue(style.fontProperty);
v.style._resetValue(style.colorProperty);
v.style._resetValue(style.textAlignmentProperty);
return true;
diff --git a/apps/ui-tests-app/pages/text/text-view.ts b/apps/ui-tests-app/pages/text/text-view.ts
index 23bdf67b3..a76943977 100644
--- a/apps/ui-tests-app/pages/text/text-view.ts
+++ b/apps/ui-tests-app/pages/text/text-view.ts
@@ -8,7 +8,6 @@ export function resetStyles(args) {
v.style._resetValue(style.fontSizeProperty);
v.style._resetValue(style.fontStyleProperty);
v.style._resetValue(style.fontWeightProperty);
- v.style._resetValue(style.fontProperty);
v.style._resetValue(style.colorProperty);
v.style._resetValue(style.textAlignmentProperty);
return true;
diff --git a/ui/core/dependency-observable.d.ts b/ui/core/dependency-observable.d.ts
index 5b265bd54..6b9acb536 100644
--- a/ui/core/dependency-observable.d.ts
+++ b/ui/core/dependency-observable.d.ts
@@ -4,6 +4,15 @@
declare module "ui/core/dependency-observable" {
import observable = require("data/observable");
+ /**
+ * Interface used by Propery 'defaultValueGetter' function to specify if the default value returned by the native instance can be cached or not.
+ * One example is - android.widget.Button background. It is state drawable so it cannot be reused/cached.
+ */
+ export interface NativeValueResult {
+ result: any;
+ cacheable: boolean;
+ }
+
/**
* Represents a special Property which supports changed callback, metadata and value validation.
*/
@@ -36,6 +45,12 @@ declare module "ui/core/dependency-observable" {
* Gets the valueConverter function associated with the property. This is a read-only property.
*/
valueConverter: (value: string) => any
+
+ /**
+ * Gets or sets the defaultValueGetter function used to get the default value for this property.
+ * If default value is 'undefined' and this property is set this function will be used to extract the default value from the native instance.
+ */
+ defaultValueGetter: (instance: DependencyObservable) => NativeValueResult;
}
/**
diff --git a/ui/core/dependency-observable.ts b/ui/core/dependency-observable.ts
index ef8d13b12..4a635aea1 100644
--- a/ui/core/dependency-observable.ts
+++ b/ui/core/dependency-observable.ts
@@ -147,6 +147,8 @@ export class Property implements definition.Property {
this._valueConverter = valueConverter;
}
+ public defaultValueGetter: (instance: definition.DependencyObservable) => definition.NativeValueResult;
+
public get name(): string {
return this._name;
}
@@ -263,6 +265,8 @@ export class PropertyEntry implements definition.PropertyEntry {
}
}
+var defaultValueForPropertyPerType: Map = new Map();
+
export class DependencyObservable extends observable.Observable {
private _propertyEntries = {};
@@ -310,6 +314,21 @@ export class DependencyObservable extends observable.Observable {
if (entry) {
return entry.effectiveValue;
}
+ else if (property.defaultValueGetter) { // we check for cached properties only for these which have 'defaultValueGetter' defined;
+ // When DependencyProperties are removed from Style - fix this check.
+ var view = (this)._view || this;
+ let key = types.getClass(view) + "." + property.id;
+ let defaultValue = defaultValueForPropertyPerType.get(key);
+ if (types.isUndefined(defaultValue) && view._nativeView) {
+ let defaultValueResult = property.defaultValueGetter(this);
+ defaultValue = defaultValueResult.result;
+ if (defaultValueResult.cacheable) {
+ defaultValueForPropertyPerType.set(key, defaultValue);
+ }
+ }
+
+ return defaultValue;
+ }
return property.metadata.defaultValue;
}
diff --git a/ui/page/page-common.ts b/ui/page/page-common.ts
index 43934104f..85881751b 100644
--- a/ui/page/page-common.ts
+++ b/ui/page/page-common.ts
@@ -42,12 +42,12 @@ export class Page extends contentView.ContentView implements dts.Page {
constructor(options?: dts.Options) {
super(options);
this.actionBar = new actionBar.ActionBar();
-
- // The default style of the page should be white background
- this.style._setValue(styleModule.backgroundColorProperty, "white", dependencyObservable.ValueSource.Inherited);
}
public onLoaded() {
+ // The default style of the page should be white background
+ this.style._setValue(styleModule.backgroundColorProperty, "white", dependencyObservable.ValueSource.Inherited);
+
this._applyCss();
if (this.actionBarHidden !== undefined) {
diff --git a/ui/styling/css-selector.ts b/ui/styling/css-selector.ts
index 5c4cdb2d6..3926bd9a2 100644
--- a/ui/styling/css-selector.ts
+++ b/ui/styling/css-selector.ts
@@ -45,17 +45,25 @@ export class CssSelector {
}
public eachSetter(callback: (property: styleProperty.Property, resolvedValue: any) => void) {
- var i,
- property: styleProperty.Property,
- resolvedValue;
+ for (let i = 0; i < this._declarations.length; i++) {
+ let declaration = this._declarations[i];
+ let name = declaration.property;
+ let resolvedValue = declaration.value;
+ let property = styleProperty.getPropertyByCssName(name);
- for (i = 0; i < this._declarations.length; i++) {
- property = styleProperty.getPropertyByCssName(this._declarations[i].property);
- if (property) {
- resolvedValue = this._declarations[i].value;
+ if (property) {
// The property.valueConverter is now used to convert the value later on in DependencyObservable._setValueInternal.
callback(property, resolvedValue);
}
+ else {
+ var pairs = styleProperty.getShorthandPairs(name, resolvedValue);
+ if (pairs) {
+ for (let j = 0; j < pairs.length; j++) {
+ let pair = pairs[j];
+ callback(pair.property, pair.value);
+ }
+ }
+ }
}
}
}
diff --git a/ui/styling/style-property.d.ts b/ui/styling/style-property.d.ts
index b2c9a27f2..0169f9173 100644
--- a/ui/styling/style-property.d.ts
+++ b/ui/styling/style-property.d.ts
@@ -2,6 +2,10 @@
import definition = require("ui/styling");
import observable = require("ui/core/dependency-observable");
+ export function getShorthandPairs(name: string, value: any): Array>;
+
+ export function registerShorthandCallback(name: string, callback: (value: any) => Array>): void;
+
export function getPropertyByName(name: string): Property;
export function getPropertyByCssName(name: string): Property;
@@ -16,4 +20,9 @@
cssName: string;
}
+
+ export interface KeyValuePair {
+ property: K;
+ value: V;
+ }
}
\ No newline at end of file
diff --git a/ui/styling/style-property.ts b/ui/styling/style-property.ts
index 85903180c..beb53d88f 100644
--- a/ui/styling/style-property.ts
+++ b/ui/styling/style-property.ts
@@ -1,9 +1,10 @@
-import definition = require("ui/styling");
+import definition = require("ui/styling/style-property");
import types = require("utils/types");
import observable = require("ui/core/dependency-observable");
var propertiesByName = {};
var propertiesByCssName = {};
+var callbackByShorthandName = new Map Array>>();
var inheritableProperties: Array = [];
function registerProperty(property: Property) {
@@ -19,6 +20,23 @@ function registerProperty(property: Property) {
}
}
+export function getShorthandPairs(name: string, value: any): Array> {
+ var callback = callbackByShorthandName.get(name);
+ if (callback) {
+ return callback(value)
+ }
+
+ return undefined;
+}
+
+export function registerShorthandCallback(name: string, callback: (value: any) => Array>): void {
+ if (callbackByShorthandName.has(name)) {
+ throw new Error("Shorthand callback already registered for property: " + name);
+ }
+
+ callbackByShorthandName.set(name, callback);
+}
+
export function getPropertyByName(name: string): Property {
return propertiesByName[name];
}
diff --git a/ui/styling/style.ts b/ui/styling/style.ts
index 79ef18b12..08a4c557d 100644
--- a/ui/styling/style.ts
+++ b/ui/styling/style.ts
@@ -1,10 +1,9 @@
import styling = require("ui/styling");
-import observable = require("ui/core/dependency-observable");
-import color = require("color");
import types = require("utils/types");
import trace = require("trace");
-import dependencyObservable = require("ui/core/dependency-observable");
-import view = require("ui/core/view");
+import {DependencyObservable, PropertyMetadata, PropertyMetadataSettings, PropertyChangeData, Property, ValueSource, NativeValueResult} from "ui/core/dependency-observable";
+import {View} from "ui/core/view";
+import {Color} from "color";
import stylers = require("ui/styling/stylers");
import styleProperty = require("ui/styling/style-property");
import converters = require("ui/styling/converters");
@@ -24,7 +23,7 @@ var _handlersCache = {};
var noStylingClasses = {};
// on Android we explicitly set propertySettings to None because android will invalidate its layout (skip unnecessary native call).
-var AffectsLayout = global.android ? dependencyObservable.PropertyMetadataSettings.None : dependencyObservable.PropertyMetadataSettings.AffectsLayout;
+var AffectsLayout = global.android ? PropertyMetadataSettings.None : PropertyMetadataSettings.AffectsLayout;
export interface Thickness {
left: number;
@@ -70,6 +69,9 @@ function parseThickness(value: any): Thickness {
} else if (types.isNumber(value)) {
result.top = result.right = result.bottom = result.left = value;
}
+ else {
+ result = value;
+ }
return result;
}
@@ -85,7 +87,7 @@ function layoutParamsComparer(x: CommonLayoutParams, y: CommonLayoutParams): boo
&& x.verticalAlignment === y.verticalAlignment
}
-function onLayoutParamsChanged(data: observable.PropertyChangeData) {
+function onLayoutParamsChanged(data: PropertyChangeData) {
var style =