diff --git a/BCL.csproj b/BCL.csproj
index d6d1f20fd..26c484dee 100644
--- a/BCL.csproj
+++ b/BCL.csproj
@@ -161,6 +161,14 @@
view.d.ts
+
+ image.d.ts
+
+
+
+ image.d.ts
+
+
diff --git a/ui/image/image.android.ts b/ui/image/image.android.ts
new file mode 100644
index 000000000..945150b48
--- /dev/null
+++ b/ui/image/image.android.ts
@@ -0,0 +1,44 @@
+
+import observable = require("ui/core/observable");
+import view = require("ui/core/view");
+import application = require("application");
+import imageSource = require("image-source");
+
+export class Image extends view.View {
+ private static sourceProperty = "source";
+ private _source: imageSource.ImageSource;
+ private _android: android.widget.ImageView;
+
+ constructor() {
+ super();
+
+ // TODO: Verify that this is always true
+ var context = application.android.currentContext;
+ if (!context) {
+ // TODO: Delayed loading?
+ }
+
+ this._android = new android.widget.ImageView(context);
+
+ }
+
+ get android(): android.widget.ImageView {
+ return this._android;
+ }
+
+ get source(): imageSource.ImageSource {
+ return this._source;
+ }
+
+ set source(value: imageSource.ImageSource) {
+ this.setProperty(Image.sourceProperty, value);
+ }
+
+ public setNativeProperty(data: observable.PropertyChangeData) {
+ if (data.propertyName === Image.sourceProperty) {
+ this._source = data.value;
+ this._android.setImageBitmap(data.value.android);
+ } else if (true) {
+ }
+ }
+}
diff --git a/ui/image/image.d.ts b/ui/image/image.d.ts
new file mode 100644
index 000000000..5156112eb
--- /dev/null
+++ b/ui/image/image.d.ts
@@ -0,0 +1,11 @@
+declare module "ui/image" {
+
+ import imageSource = require("image-source");
+
+ class Image {
+ android: android.widget.ImageView;
+ ios: UIKit.UIImageView;
+
+ source: imageSource.ImageSource;
+ }
+}
\ No newline at end of file
diff --git a/ui/image/image.ios.ts b/ui/image/image.ios.ts
new file mode 100644
index 000000000..f70988f3b
--- /dev/null
+++ b/ui/image/image.ios.ts
@@ -0,0 +1,36 @@
+
+import observable = require("ui/core/observable");
+import view = require("ui/core/view");
+import imageSource = require("image-source");
+
+export class Image extends view.View {
+ private static sourceProperty = "source";
+ private _source: imageSource.ImageSource;
+ private _ios: UIKit.UIImageView;
+
+ constructor() {
+ super();
+ this._ios = new UIKit.UIImageView();
+ }
+
+ get ios(): UIKit.UIImageView {
+ return this._ios;
+ }
+
+ get source(): imageSource.ImageSource {
+ return this._source;
+ }
+
+ set source(value: imageSource.ImageSource) {
+ this.setProperty(Image.sourceProperty, value);
+ }
+
+ public setNativeProperty(data: observable.PropertyChangeData) {
+ if (data.propertyName === Image.sourceProperty) {
+ this._source = data.value;
+ this._ios.image = this._source.ios;
+ this._ios.sizeToFit();
+ } else if (true) {
+ }
+ }
+}
\ No newline at end of file
diff --git a/ui/image/index.ts b/ui/image/index.ts
new file mode 100644
index 000000000..1ace44111
--- /dev/null
+++ b/ui/image/index.ts
@@ -0,0 +1,2 @@
+declare var module, require;
+module.exports = require("ui/image/image");
\ No newline at end of file
diff --git a/ui/label/label.ios.ts b/ui/label/label.ios.ts
index 8b242082d..d853bddfc 100644
--- a/ui/label/label.ios.ts
+++ b/ui/label/label.ios.ts
@@ -16,7 +16,7 @@ export class Label extends view.View {
var extendsBody = Foundation.NSObject.extends(
{
observeValueForKeyPathOfObjectChangeContext: function (path: string, sender: Foundation.NSObject, change: Foundation.NSDictionary, context) {
- that.updateTwoWayBinding(Label.textProperty, change.objectForKey("new"));
+ that.updateTwoWayBinding(Label.textProperty, change.objectForKey(Foundation.NSKeyValueChangeNewKey));
}
}, {});