/*
- * Copyright(c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
+* Copyright(c) 2018 Samsung Electronics Co., Ltd.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
using System;
using System.Runtime.InteropServices;
using System.ComponentModel;
Tizen.NUI.Object.GetProperty(imageView.swigCPtr, ImageView.Property.IMAGE).Get(out imageView._url);
return imageView._url;
});
+
/// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public static readonly BindableProperty ImageProperty = BindableProperty.Create("Image", typeof(PropertyMap), typeof(ImageView), null, propertyChanged: (bindable, oldValue, newValue) =>
+ public static readonly BindableProperty ImageProperty = BindableProperty.Create(nameof(ImageView.Image), typeof(PropertyMap), typeof(ImageView), null, propertyChanged: (bindable, oldValue, newValue) =>
{
var imageView = (ImageView)bindable;
if (newValue != null)
}
if (imageView._border == null)
{
- Tizen.NUI.Object.SetProperty(imageView.swigCPtr, ImageView.Property.IMAGE, new Tizen.NUI.PropertyValue(map));
+ imageView._image = map;
+ imageView.UpdateImage();
}
}
},
return null;
}
});
+
/// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public static readonly BindableProperty PreMultipliedAlphaProperty = BindableProperty.Create("PreMultipliedAlpha", typeof(bool), typeof(ImageView), false, propertyChanged: (bindable, oldValue, newValue) =>
Tizen.NUI.Object.GetProperty(imageView.swigCPtr, ImageView.Property.PRE_MULTIPLIED_ALPHA).Get(out temp);
return temp;
});
+
/// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public static readonly BindableProperty PixelAreaProperty = BindableProperty.Create("PixelArea", typeof(RelativeVector4), typeof(ImageView), null, propertyChanged: (bindable, oldValue, newValue) =>
RelativeVector4 relativeTemp = new RelativeVector4(temp.X, temp.Y, temp.Z, temp.W);
return relativeTemp;
});
+
/// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public static readonly BindableProperty BorderProperty = BindableProperty.Create("Border", typeof(Rectangle), typeof(ImageView), null, propertyChanged: (bindable, oldValue, newValue) =>
var imageView = (ImageView)bindable;
return imageView._border;
});
+
/// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public static readonly BindableProperty BorderOnlyProperty = BindableProperty.Create("BorderOnly", typeof(bool), typeof(ImageView), false, propertyChanged: (bindable, oldValue, newValue) =>
var imageView = (ImageView)bindable;
return imageView._borderOnly ?? false;
});
+
/// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public static readonly BindableProperty SynchronosLoadingProperty = BindableProperty.Create("SynchronosLoading", typeof(bool), typeof(ImageView), false, propertyChanged: (bindable, oldValue, newValue) =>
var imageView = (ImageView)bindable;
return imageView._synchronousLoading ?? false;
});
+
/// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public static readonly BindableProperty OrientationCorrectionProperty = BindableProperty.Create("OrientationCorrection", typeof(bool), typeof(ImageView), false, propertyChanged: (bindable, oldValue, newValue) =>
private EventHandler<ResourceLoadedEventArgs> _resourceLoadedEventHandler;
private _resourceLoadedCallbackType _resourceLoadedCallback;
- private Rectangle _border = null;
- private PropertyMap _nPatchMap = null;
- private bool? _synchronousLoading = null;
- private bool? _borderOnly = null;
- private string _url = null;
- private bool? _orientationCorrection = null;
-
+ private Rectangle _border;
+ private PropertyMap _nPatchMap;
+ private bool? _synchronousLoading;
+ private bool? _borderOnly;
+ private string _url;
+ private bool? _orientationCorrection;
+ private PropertyMap _image;
/// <summary>
/// Creates an initialized ImageView.
}
set
{
- _url = (value == null? "" : value);
+ _url = (value == null ? "" : value);
SetValue(ResourceUrlProperty, _url);
NotifyPropertyChanged();
}
/// Instead please use as keyword.
/// <since_tizen> 3 </since_tizen>
[Obsolete("Please do not use! This will be deprecated! Please use as keyword instead! " +
- "Like: " +
- "BaseHandle handle = new ImageView(imagePath); " +
- "ImageView image = handle as ImageView")]
+ "Like: " +
+ "BaseHandle handle = new ImageView(imagePath); " +
+ "ImageView image = handle as ImageView")]
[EditorBrowsable(EditorBrowsableState.Never)]
public static ImageView DownCast(BaseHandle handle)
{
_border = null;
_nPatchMap?.Dispose();
_nPatchMap = null;
+ _image?.Dispose();
+ _image = null;
}
//Release your own unmanaged resources here.
SetProperty(ImageView.Property.IMAGE, new PropertyValue(_url));
}
}
+ else
+ {
+ //Image property is set and used
+ PropertyMap map = new PropertyMap();
+ map.Insert(ImageVisualProperty.URL, new PropertyValue(""));
+ if (_synchronousLoading != null)
+ {
+ map.Insert(ImageVisualProperty.SynchronousLoading, new PropertyValue((bool)_synchronousLoading));
+ }
+ if (_orientationCorrection != null)
+ {
+ map.Insert(ImageVisualProperty.OrientationCorrection, new PropertyValue((bool)_orientationCorrection));
+ }
+ if (_image != null)
+ {
+ map.Merge(_image);
+ }
+ SetProperty(ImageView.Property.IMAGE, new PropertyValue(map));
+ }
}
private void OnResourceLoaded(IntPtr view)