diff --git a/CrossPlatformModules.csproj b/CrossPlatformModules.csproj index 59a20fcbd..2d041153b 100644 --- a/CrossPlatformModules.csproj +++ b/CrossPlatformModules.csproj @@ -543,6 +543,7 @@ + @@ -1517,7 +1518,7 @@ False - + \ No newline at end of file diff --git a/apps/TelerikNEXT/images/background.jpg b/apps/TelerikNEXT/images/background.jpg new file mode 100644 index 000000000..3c8134b00 Binary files /dev/null and b/apps/TelerikNEXT/images/background.jpg differ diff --git a/apps/TelerikNEXT/main-page.xml b/apps/TelerikNEXT/main-page.xml index 609b2f9cf..2f3ffce60 100644 --- a/apps/TelerikNEXT/main-page.xml +++ b/apps/TelerikNEXT/main-page.xml @@ -23,29 +23,31 @@ - + - - - - - - - + + + + + + + + - + + - + - + diff --git a/ui/styling/style.ts b/ui/styling/style.ts index 78743a2cf..b48a4701e 100644 --- a/ui/styling/style.ts +++ b/ui/styling/style.ts @@ -9,6 +9,7 @@ import stylers = require("ui/styling/stylers"); import styleProperty = require("ui/styling/style-property"); import converters = require("ui/styling/converters"); import enums = require("ui/enums"); +import imageSource = require("image-source"); // key is the property id and value is Dictionary; var _registeredHandlers = {}; @@ -34,6 +35,13 @@ export class Style extends observable.DependencyObservable implements styling.St this._setValue(backgroundColorProperty, value, observable.ValueSource.Local); } + get backgroundImage(): string { + return this._getValue(backgroundImageProperty); + } + set backgroundImage(value: string) { + this._setValue(backgroundImageProperty, value, observable.ValueSource.Local); + } + get fontSize(): number { return this._getValue(fontSizeProperty); } @@ -279,9 +287,9 @@ export class Style extends observable.DependencyObservable implements styling.St } } -export function registerHandler(property: dependencyObservable.Property, - handler: styling.stylers.StylePropertyChangedHandler, - className?: string) { +export function registerHandler(property: dependencyObservable.Property, + handler: styling.stylers.StylePropertyChangedHandler, + className?: string) { var realClassName = className ? className : "default"; if (_registeredHandlers.hasOwnProperty(property.id + "")) { _registeredHandlers[property.id][realClassName] = handler; @@ -332,6 +340,26 @@ export var colorProperty = new styleProperty.Property("color", "color", new observable.PropertyMetadata(undefined, observable.PropertyMetadataSettings.Inheritable, undefined, undefined, color.Color.equals), converters.colorConverter); +export var backgroundImageProperty = new styleProperty.Property("backgroundImage", "background-image", + new observable.PropertyMetadata(undefined, observable.PropertyMetadataSettings.None, onBackgroundImagePropertyChanged)); + +function onBackgroundImagePropertyChanged(data: observable.PropertyChangeData) { + var style =