public Animation AnimateColor(string targetVisual, object destinationColor, int startTime, int endTime, AlphaFunction.BuiltinFunctions? alphaFunction = null, object initialColor = null)
{
Animation animation = null;
+ using (PropertyMap animator = new PropertyMap())
+ using (PropertyMap timePeriod = new PropertyMap())
+ using (PropertyValue pvDuration = new PropertyValue((endTime - startTime) / 1000.0f))
+ using (PropertyValue pvDelay = new PropertyValue(startTime / 1000.0f))
+ using (PropertyMap transition = new PropertyMap())
+ using (PropertyValue pvTarget = new PropertyValue(targetVisual))
+ using (PropertyValue pvProperty = new PropertyValue("mixColor"))
+ using (PropertyValue destValue = PropertyValue.CreateFromObject(destinationColor))
{
- PropertyMap _animator = new PropertyMap();
if (alphaFunction != null)
{
- _animator.Add("alphaFunction", new PropertyValue(AlphaFunction.BuiltinToPropertyKey(alphaFunction)));
+ using (PropertyValue pvAlpha = new PropertyValue(AlphaFunction.BuiltinToPropertyKey(alphaFunction)))
+ {
+ animator.Add("alphaFunction", pvAlpha);
+ }
}
- PropertyMap _timePeriod = new PropertyMap();
- _timePeriod.Add("duration", new PropertyValue((endTime - startTime) / 1000.0f));
- _timePeriod.Add("delay", new PropertyValue(startTime / 1000.0f));
- _animator.Add("timePeriod", new PropertyValue(_timePeriod));
-
- PropertyMap _transition = new PropertyMap();
- _transition.Add("animator", new PropertyValue(_animator));
- _transition.Add("target", new PropertyValue(targetVisual));
- _transition.Add("property", new PropertyValue("mixColor"));
+ timePeriod.Add("duration", pvDuration);
+ timePeriod.Add("delay", pvDelay);
+ using (PropertyValue pvTimePeriod = new PropertyValue(timePeriod))
+ {
+ animator.Add("timePeriod", pvTimePeriod);
+ }
+ using (PropertyValue pvAnimator = new PropertyValue(animator))
+ {
+ transition.Add("animator", pvAnimator);
+ }
+ transition.Add("target", pvTarget);
+ transition.Add("property", pvProperty);
if (initialColor != null)
{
- PropertyValue initValue = PropertyValue.CreateFromObject(initialColor);
- _transition.Add("initialValue", initValue);
+ using (PropertyValue initValue = PropertyValue.CreateFromObject(initialColor))
+ {
+ transition.Add("initialValue", initValue);
+ }
}
- PropertyValue destValue = PropertyValue.CreateFromObject(destinationColor);
- _transition.Add("targetValue", destValue);
- TransitionData _transitionData = new TransitionData(_transition);
-
- animation = new Animation(Interop.View.CreateTransition(SwigCPtr, TransitionData.getCPtr(_transitionData)), true);
+ transition.Add("targetValue", destValue);
+ using (TransitionData transitionData = new TransitionData(transition))
+ {
+ animation = new Animation(Interop.View.CreateTransition(SwigCPtr, TransitionData.getCPtr(transitionData)), true);
+ }
if (NDalicPINVOKE.SWIGPendingException.Pending)
throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
};
ChildAdded(this, e);
}
- BindableObject.SetInheritedBindingContext(child, this?.BindingContext);
+
+ AddChildBindableObject(child);
}
}
/// </summary>
/// <seealso cref="Container.Remove" />
/// <since_tizen> 4 </since_tizen>
+ /// <exception cref="InvalidOperationException">Thrown when deleting a view that is not a child of this view</exception>
public override void Remove(View child)
{
if (child == null || child.GetParent() == null) // Early out if child null.
return;
+ if (child.GetParent() != this)
+ {
+ //throw new System.InvalidOperationException("You have deleted a view that is not a child of this view.");
+ Tizen.Log.Error("NUI", "You have deleted a view that is not a child of this view.");
+ }
+
bool hasLayout = (layout != null);
// If View has a layout then do a deferred child removal
/// </summary>
/// <seealso cref="Container.GetChildCount" />
/// <since_tizen> 4 </since_tizen>
+ [Obsolete("Deprecated in API9, will be removed in API11. Please use ChildCount property instead!")]
public override uint GetChildCount()
{
return Convert.ToUInt32(Children.Count);
}
else
{
- Tizen.Log.Error("NUI", "swigCPtr of view is aleady disposed.");
+ Tizen.Log.Error("NUI", "swigCPtr of view is already disposed.");
}
return ret;
}
/// </summary>
/// <param name="styleName">A string matching a style described in a stylesheet.</param>
/// <since_tizen> 3 </since_tizen>
+ [Obsolete("Deprecated in API9, will be removed in API11. Please use StyleName property instead!")]
public void SetStyleName(string styleName)
{
Interop.View.SetStyleName(SwigCPtr, styleName);
/// </summary>
/// <returns>A string matching a style, or an empty string.</returns>
/// <since_tizen> 3 </since_tizen>
+ [Obsolete("Deprecated in API9, will be removed in API11. Please use StyleName property instead!")]
public string GetStyleName()
{
string ret = Interop.View.GetStyleName(SwigCPtr);
/// <since_tizen> 3 </since_tizen>
public void Show()
{
+ if ((AccessibilityCalculateStates() & AccessibilityStates.Modal) != 0)
+ {
+ RegisterPopup();
+ }
+
SetVisible(true);
}
public void Hide()
{
SetVisible(false);
+
+ if ((AccessibilityCalculateStates() & AccessibilityStates.Modal) != 0)
+ {
+ RemovePopup();
+ }
}
/// <summary>
/// <param name="width">The width to use.</param>
/// <returns>The height based on the width.</returns>
/// <since_tizen> 3 </since_tizen>
+ [Obsolete("Deprecated in API9, will be removed in API11. Please use HeightForWidth property instead!")]
public float GetHeightForWidth(float width)
{
float ret = Interop.Actor.GetHeightForWidth(SwigCPtr, width);
/// <param name="height">The height to use.</param>
/// <returns>The width based on the height.</returns>
/// <since_tizen> 3 </since_tizen>
+ [Obsolete("Deprecated in API9, will be removed in API11. Please use WidthForHeight property instead!")]
public float GetWidthForHeight(float height)
{
float ret = Interop.Actor.GetWidthForHeight(SwigCPtr, height);
/// </summary>
/// <param name="padding">Padding for the view.</param>
/// <since_tizen> 3 </since_tizen>
+ // [Obsolete("Deprecated in API9, will be removed in API11. Please use Padding property instead!")]
public void SetPadding(PaddingType padding)
{
Interop.Actor.SetPadding(SwigCPtr, PaddingType.getCPtr(padding));
/// </summary>
/// <param name="paddingOut">the value of padding for the view</param>
/// <since_tizen> 3 </since_tizen>
+ [Obsolete("Deprecated in API9, will be removed in API11. Please use Padding property instead!")]
public void GetPadding(PaddingType paddingOut)
{
Interop.Actor.GetPadding(SwigCPtr, PaddingType.getCPtr(paddingOut));
throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
-
-
- /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public Transition GetTransition(string transitionName)
- {
- Transition trans = null;
- transDictionary.TryGetValue(transitionName, out trans);
- return trans;
- }
-
/// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public void ObjectDump()
view.ObjectDump();
}
}
+
+ /// <summary>
+ /// Search through this View's hierarchy for a View with the given unique ID.
+ /// The View itself is also considered in the search.
+ /// </summary>
+ /// <param name="id">The ID of the View to find</param>
+ /// <returns>A View if found or a null if not</returns>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public View FindChildByID(uint id)
+ {
+ IntPtr cPtr = Interop.Actor.FindChildById(SwigCPtr, id);
+ View ret = this.GetInstanceSafely<View>(cPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
}
}