internal uint GetDepth()
{
- uint ret = NDalicPINVOKE.Layer_GetDepth(swigCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
+ var parentChildren = Window.Instance.LayersChildren;
+ if(parentChildren != null)
+ {
+ int idx = parentChildren.IndexOf(this);
+ if (idx >= 0)
+ {
+ return Convert.ToUInt32(idx); ;
+ }
+ }
+ return 0u;
}
/// <summary>
/// <since_tizen> 3 </since_tizen>
public void Raise()
{
- NDalicPINVOKE.Layer_Raise(swigCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ var parentChildren = Window.Instance.LayersChildren;
+ if (parentChildren != null)
+ {
+ int currentIdx = parentChildren.IndexOf(this);
+
+ if (currentIdx != parentChildren.Count - 1)
+ {
+ RaiseAbove(parentChildren[currentIdx + 1]);
+
+ Layer temp = parentChildren[currentIdx + 1];
+ parentChildren[currentIdx + 1] = this;
+ parentChildren[currentIdx] = temp;
+ }
+ }
}
/// <summary>
/// <since_tizen> 3 </since_tizen>
public void Lower()
{
- NDalicPINVOKE.Layer_Lower(swigCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ var parentChildren = Window.Instance.LayersChildren;
+ if (parentChildren != null)
+ {
+ int currentIdx = parentChildren.IndexOf(this);
+
+ if (currentIdx > 0)
+ {
+ LowerBelow(parentChildren[currentIdx - 1]);
+
+ Layer temp = parentChildren[currentIdx - 1];
+ parentChildren[currentIdx - 1] = this;
+ parentChildren[currentIdx] = temp;
+
+ }
+ }
}
internal void RaiseAbove(Layer target)
/// <since_tizen> 3 </since_tizen>
public void RaiseToTop()
{
+ var parentChildren = Window.Instance.LayersChildren;
+
+ if (parentChildren != null)
+ {
+ parentChildren.Remove(this);
+ parentChildren.Add(this);
+ }
NDalicPINVOKE.Layer_RaiseToTop(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <since_tizen> 3 </since_tizen>
public void LowerToBottom()
{
+ var parentChildren = Window.Instance.LayersChildren;
+
+ if (parentChildren != null)
+ {
+ parentChildren.Remove(this);
+ parentChildren.Insert(0, this);
+ }
+
NDalicPINVOKE.Layer_LowerToBottom(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
private string _windowTitle;
private List<Layer> _childLayers = new List<Layer>();
- private List<Layer> LayersChildren
+ internal List<Layer> LayersChildren
{
get
{
/// <since_tizen> 3 </since_tizen>
public Layer GetLayer(uint depth)
{
- IntPtr cPtr = NDalicPINVOKE.Stage_GetLayer(stageCPtr, depth);
- Layer ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Layer;
-
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
+ if (depth < LayersChildren.Count)
+ {
+ Layer ret = LayersChildren[Convert.ToInt32(depth)];
+ return ret;
+ }
+ else
+ {
+ return null;
+ }
}
internal Layer GetRootLayer()