Merge "[Tizen] Remove Visible propert in View." into tizen
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / BaseComponents / View.cs
index 391dc41..cedb4d0 100755 (executable)
@@ -820,7 +820,14 @@ namespace Tizen.NUI.BaseComponents
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
-        [Obsolete("Please do not use! this will be deprecated, instead please us as keyword.")]
+        /// <summary>
+        /// Downcasts a handle to View handle.<br>
+        /// If handle points to a View, the downcast produces valid handle.<br>
+        /// If not, the returned handle is left uninitialized.<br>
+        /// </summary>
+        /// <param name="handle">Handle to an object</param>
+        /// <returns>A handle to a View or an uninitialized handle</returns>
+        [Obsolete("Please do not use! this will be deprecated, instead please use as keyword.")]
         public new static View DownCast(BaseHandle handle)
         {
             View ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as View;
@@ -828,7 +835,7 @@ namespace Tizen.NUI.BaseComponents
             return ret;
         }
 
-        [Obsolete("Please do not use! this will be deprecated, instead please us as keyword.")]
+        [Obsolete("Please do not use! this will be deprecated, instead please use as keyword.")]
         public static T DownCast<T>(View view) where T : View
         {
             T ret = Registry.GetManagedBaseHandleFromNativePtr(view) as T;
@@ -2145,9 +2152,19 @@ namespace Tizen.NUI.BaseComponents
 
         /*internal View GetParent()
         {
+            View ret;
             IntPtr cPtr = NDalicPINVOKE.Actor_GetParent(swigCPtr);
 
-            View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View;
+            BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(cPtr);
+
+            if(basehandle is Layer)
+            {
+                ret = new View(cPtr,false);
+            }
+            else
+            {
+                ret = basehandle as View;
+            }
 
             if (NDalicPINVOKE.SWIGPendingException.Pending)
                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();