[Tizen] Fixed many issues.
authorUmar <m.umar@partner.samsung.com>
Fri, 21 Jul 2017 13:30:58 +0000 (14:30 +0100)
committerdongsug.song <dongsug.song@samsung.com>
Wed, 26 Jul 2017 22:53:18 +0000 (07:53 +0900)
1- Making DownCast APIs backward compatible.
2- Making use of Registry instead of creating extra managed object.
3- Corrected conversion of Uint16Pair to Size2D.
4- using correct swigCpt in few APIs (eg Window_ResizedSignal)

Conflicts:
NUISamples/NUISamples/NUISamples.TizenTV/examples/hello-world.cs
Tizen.NUI/src/public/BaseComponents/View.cs

Change-Id: Ib18446dbda2602757079145ae882c9b1fc075d08

59 files changed:
NUISamples/NUISamples/NUISamples.TizenTV/examples/date-picker-using-json/date-picker-using-json.cs
NUISamples/NUISamples/NUISamples.TizenTV/examples/hello-world.cs
NUISamples/NUISamples/NUISamples.TizenTV/examples/sibling-order-test.cs
NUISamples/NUISamples/NUISamples.TizenTV/examples/test1.cs
NUISamples/NUISamples/NUISamples.TizenTV/examples/visuals-using-custom-view/ContactView.cs
src/Tizen.NUI/src/internal/Alignment.cs
src/Tizen.NUI/src/internal/AsyncImageLoader.cs
src/Tizen.NUI/src/internal/BufferImage.cs
src/Tizen.NUI/src/internal/Builder.cs
src/Tizen.NUI/src/internal/Camera.cs
src/Tizen.NUI/src/internal/CustomActor.cs
src/Tizen.NUI/src/internal/EncodedBufferImage.cs
src/Tizen.NUI/src/internal/FrameBuffer.cs
src/Tizen.NUI/src/internal/FrameBufferImage.cs
src/Tizen.NUI/src/internal/GaussianBlurView.cs
src/Tizen.NUI/src/internal/GestureDetector.cs
src/Tizen.NUI/src/internal/Image.cs
src/Tizen.NUI/src/internal/ItemView.cs
src/Tizen.NUI/src/internal/LinearConstrainer.cs
src/Tizen.NUI/src/internal/LongPressGestureDetector.cs
src/Tizen.NUI/src/internal/Model3dView.cs
src/Tizen.NUI/src/internal/NativeImage.cs
src/Tizen.NUI/src/internal/PageTurnLandscapeView.cs
src/Tizen.NUI/src/internal/PageTurnPortraitView.cs
src/Tizen.NUI/src/internal/PageTurnView.cs
src/Tizen.NUI/src/internal/PanGestureDetector.cs
src/Tizen.NUI/src/internal/PathConstrainer.cs
src/Tizen.NUI/src/internal/PinchGestureDetector.cs
src/Tizen.NUI/src/internal/PropertyNotification.cs
src/Tizen.NUI/src/internal/RenderTask.cs
src/Tizen.NUI/src/internal/RenderTaskList.cs
src/Tizen.NUI/src/internal/ScrollViewPagePathEffect.cs
src/Tizen.NUI/src/internal/TapGestureDetector.cs
src/Tizen.NUI/src/internal/TouchPoint.cs
src/Tizen.NUI/src/internal/ViewImpl.cs
src/Tizen.NUI/src/internal/ViewWrapperImpl.cs
src/Tizen.NUI/src/public/Animation.cs
src/Tizen.NUI/src/public/BaseComponents/ImageView.cs
src/Tizen.NUI/src/public/BaseComponents/TableView.cs
src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs
src/Tizen.NUI/src/public/BaseComponents/TextField.cs
src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs
src/Tizen.NUI/src/public/BaseComponents/VideoView.cs
src/Tizen.NUI/src/public/BaseComponents/View.cs
src/Tizen.NUI/src/public/BaseComponents/VisualView.cs
src/Tizen.NUI/src/public/CustomView/Spin.cs
src/Tizen.NUI/src/public/KeyFrames.cs
src/Tizen.NUI/src/public/Layer.cs
src/Tizen.NUI/src/public/Path.cs
src/Tizen.NUI/src/public/Renderer.cs
src/Tizen.NUI/src/public/TextureSet.cs
src/Tizen.NUI/src/public/Timer.cs
src/Tizen.NUI/src/public/Touch.cs
src/Tizen.NUI/src/public/UIComponents/Popup.cs
src/Tizen.NUI/src/public/UIComponents/PushButton.cs
src/Tizen.NUI/src/public/UIComponents/ScrollBar.cs
src/Tizen.NUI/src/public/UIComponents/Slider.cs
src/Tizen.NUI/src/public/VisualFactory.cs
src/Tizen.NUI/src/public/Window.cs

index 5344d55..56e7ab9 100755 (executable)
@@ -64,9 +64,7 @@ namespace DatePickerUsingJson
             _builder.LoadFromFile(_resPath + "/json/date-picker-template.json" );
 
             // create the date-picker from the template in the json file
-            BaseHandle handle =  _builder.Create( "date-picker");
-
-            View actorTree =  View.DownCast( handle );
+            View actorTree =  _builder.Create( "date-picker");
 
             window.Add( actorTree );
 
index 58fbbe5..8cd8f1d 100755 (executable)
@@ -57,8 +57,8 @@ namespace HelloWorldTest
             window.KeyEvent += OnWindowKeyEvent;
             window.Resized += (obj, e) =>
             {
-                Tizen.Log.Debug("NUI", "Height: " + e.WindowSize.GetHeight());
-                Tizen.Log.Debug("NUI", "Width: " + e.WindowSize.GetWidth());
+                Tizen.Log.Debug("NUI", "Height: " + e.WindowSize.Height);
+                Tizen.Log.Debug("NUI", "Width: " + e.WindowSize.Width);
             };
 
             TextLabel pixelLabel = new TextLabel("Test Pixel Size 32.0f");
index e07f7d5..eaf9f69 100755 (executable)
@@ -104,9 +104,9 @@ namespace SiblingOrderTest
                 _view.ParentOrigin = ParentOrigin.TopLeft;
                 _view.PivotPoint = PivotPoint.TopLeft;
                 _view.Position2D = _myPos + new Position2D(20 * i, 10 * i);
-                _view.SiblingOrder = i;
 
                 _window.Add(_view);
+                _view.SiblingOrder = i;
             }
         }
 
@@ -124,9 +124,9 @@ namespace SiblingOrderTest
                 _view.ParentOrigin = ParentOrigin.TopLeft;
                 _view.PivotPoint = PivotPoint.TopLeft;
                 _view.Position2D = _myPos + new Position2D(20 * i, 10 * i);
-                _view.SiblingOrder = 10-i;
 
                 _window.Add(_view);
+                _view.SiblingOrder = 10-i;
             }
         }
 
@@ -144,6 +144,9 @@ namespace SiblingOrderTest
                 _view.ParentOrigin = ParentOrigin.TopLeft;
                 _view.PivotPoint = PivotPoint.TopLeft;
                 _view.Position2D = _myPos + new Position2D(20 * i, 10 * i);
+
+                _window.Add(_view);
+
                 if (i<5)
                 {
                     _view.SiblingOrder = 5-i;
@@ -152,8 +155,6 @@ namespace SiblingOrderTest
                 {
                     _view.SiblingOrder = i-5;
                 }
-
-                _window.Add(_view);
             }
         }
 
@@ -171,6 +172,9 @@ namespace SiblingOrderTest
                 _view.ParentOrigin = ParentOrigin.TopLeft;
                 _view.PivotPoint = PivotPoint.TopLeft;
                 _view.Position2D = _myPos + new Position2D(20 * i, 10 * i);
+
+                _window.Add(_view);
+
                 if (i<5)
                 {
                     _view.SiblingOrder = i;
@@ -179,8 +183,6 @@ namespace SiblingOrderTest
                 {
                     _view.SiblingOrder = 10-i;
                 }
-
-                _window.Add(_view);
             }
         }
 
index 42c79a6..583784d 100644 (file)
@@ -161,7 +161,7 @@ namespace Test1
                         .Add(TextVisualProperty.PointSize, new PropertyValue(10))
                         .Add(TextVisualProperty.HorizontalAlignment, new PropertyValue("CENTER"))
                         .Add(TextVisualProperty.VerticalAlignment, new PropertyValue("CENTER"));
-                    _textVisual = VisualFactory.Get().CreateVisual(textVisual);
+                    _textVisual = VisualFactory.Instance.CreateVisual(textVisual);
                     RegisterVisual(TextVisualPropertyIndex, _textVisual);
                     _textVisual.DepthIndex = TextVisualPropertyIndex;
                 }
index 1e25c73..7ab8794 100644 (file)
@@ -53,7 +53,7 @@ namespace VisualsUsingCustomView
             CustomViewRegistry.Instance.Register( CreateInstance, typeof(ContactView));
         }
 
-        public ContactView() : base(typeof(ContactView).Name, CustomViewBehaviour.RequiresKeyboardNavigationSupport)
+        public ContactView() : base(typeof(ContactView).FullName, CustomViewBehaviour.RequiresKeyboardNavigationSupport)
         {
         }
 
@@ -79,7 +79,7 @@ namespace VisualsUsingCustomView
                 imageVisual.Add( Visual.Property.Type, new PropertyValue( (int)Visual.Type.Image ))
                     .Add( ImageVisualProperty.URL, new PropertyValue( _imageURL ) )
                     .Add( ImageVisualProperty.AlphaMaskURL, new PropertyValue( _maskURL ));
-                _imageVisual =  VisualFactory.Get().CreateVisual( imageVisual );
+                _imageVisual =  VisualFactory.Instance.CreateVisual( imageVisual );
 
                 RegisterVisual( GetPropertyIndex("ImageURL"), _imageVisual );
 
@@ -107,7 +107,7 @@ namespace VisualsUsingCustomView
                     .Add(TextVisualProperty.PointSize, new PropertyValue(7))
                     .Add( TextVisualProperty.HorizontalAlignment, new PropertyValue("CENTER"))
                     .Add( TextVisualProperty.VerticalAlignment, new PropertyValue("CENTER"));
-                _textVisual =  VisualFactory.Get().CreateVisual( textVisual );
+                _textVisual =  VisualFactory.Instance.CreateVisual( textVisual );
 
                 RegisterVisual( GetPropertyIndex("Name"), _textVisual );
 
@@ -149,7 +149,7 @@ namespace VisualsUsingCustomView
                     .Add( PrimitiveVisualProperty.BevelSmoothness, new PropertyValue(0.0f))
                     .Add( PrimitiveVisualProperty.ScaleDimensions, new PropertyValue(new Vector3(1.0f,1.0f,0.3f)))
                     .Add( PrimitiveVisualProperty.MixColor, new PropertyValue(new Vector4((245.0f/255.0f), (188.0f/255.0f), (73.0f/255.0f), 1.0f)));
-                _primitiveVisual =  VisualFactory.Get().CreateVisual( primitiveVisual );
+                _primitiveVisual =  VisualFactory.Instance.CreateVisual( primitiveVisual );
                 RegisterVisual( GetPropertyIndex("Shape"), _primitiveVisual );
 
                 // Set the depth index for Primitive visual
index e64520e..c49d4f7 100755 (executable)
@@ -242,7 +242,7 @@ namespace Tizen.NUI
 
         public new static Alignment DownCast(BaseHandle handle)
         {
-            Alignment ret = new Alignment(NDalicPINVOKE.Alignment_DownCast(BaseHandle.getCPtr(handle)), true);
+            Alignment ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Alignment;
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index f3f122d..d01e131 100755 (executable)
@@ -82,7 +82,7 @@ namespace Tizen.NUI
 
         public static AsyncImageLoader DownCast(BaseHandle handle)
         {
-            AsyncImageLoader ret = new AsyncImageLoader(NDalicPINVOKE.AsyncImageLoader_DownCast(BaseHandle.getCPtr(handle)), true);
+            AsyncImageLoader ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as AsyncImageLoader;
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 0db41cf..0f15466 100755 (executable)
@@ -93,7 +93,7 @@ namespace Tizen.NUI
         }
         public new static BufferImage DownCast(BaseHandle handle)
         {
-            BufferImage ret = new BufferImage(NDalicPINVOKE.BufferImage_DownCast(BaseHandle.getCPtr(handle)), true);
+            BufferImage ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as BufferImage;
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index b826f65..aaa87be 100755 (executable)
@@ -218,9 +218,9 @@ namespace Tizen.NUI
             return ret;
         }
 
-        public BaseHandle Create(string templateName)
+        public View Create(string templateName)
         {
-            BaseHandle ret = new BaseHandle(NDalicPINVOKE.Builder_Create__SWIG_0(swigCPtr, templateName), true);
+            View ret = new View(NDalicPINVOKE.Builder_Create__SWIG_0(swigCPtr, templateName), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 7f98d94..f43ba7f 100755 (executable)
@@ -181,7 +181,7 @@ namespace Tizen.NUI
         }
         public new static Camera DownCast(BaseHandle handle)
         {
-            Camera ret = new Camera(NDalicPINVOKE.CameraActor_DownCast(BaseHandle.getCPtr(handle)), true);
+            Camera ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Camera;
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 8bea2d1..6f7bf4d 100755 (executable)
@@ -70,7 +70,7 @@ namespace Tizen.NUI
 
         public new static CustomActor DownCast(BaseHandle handle)
         {
-            CustomActor ret = new CustomActor(NDalicPINVOKE.CustomActor_DownCast(BaseHandle.getCPtr(handle)), true);
+            CustomActor ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as CustomActor;
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 6f801c7..4019bc6 100755 (executable)
@@ -80,7 +80,7 @@ namespace Tizen.NUI
         }
         public new static EncodedBufferImage DownCast(BaseHandle handle)
         {
-            EncodedBufferImage ret = new EncodedBufferImage(NDalicPINVOKE.EncodedBufferImage_DownCast(BaseHandle.getCPtr(handle)), true);
+            EncodedBufferImage ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as EncodedBufferImage;
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index aba063a..1db1867 100755 (executable)
@@ -94,7 +94,9 @@ namespace Tizen.NUI
 
         public Texture GetColorTexture()
         {
-            Texture ret = new Texture(NDalicPINVOKE.FrameBuffer_GetColorTexture(swigCPtr), true);
+            global::System.IntPtr cPtr = NDalicPINVOKE.FrameBuffer_GetColorTexture(swigCPtr);
+            Texture ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Texture;
+
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 3646b8a..7cc5961 100755 (executable)
@@ -97,7 +97,7 @@ namespace Tizen.NUI
         }
         public new static FrameBufferImage DownCast(BaseHandle handle)
         {
-            FrameBufferImage ret = new FrameBufferImage(NDalicPINVOKE.FrameBufferImage_DownCast(BaseHandle.getCPtr(handle)), true);
+            FrameBufferImage ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as FrameBufferImage;
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index b9e2cdd..306c597 100755 (executable)
@@ -168,7 +168,7 @@ namespace Tizen.NUI
 
         public new static GaussianBlurView DownCast(BaseHandle handle)
         {
-            GaussianBlurView ret = new GaussianBlurView(NDalicPINVOKE.GaussianBlurView_DownCast(BaseHandle.getCPtr(handle)), true);
+            GaussianBlurView ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as GaussianBlurView;
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index faf27a3..a9e8217 100755 (executable)
@@ -70,7 +70,7 @@ namespace Tizen.NUI
 
         public new static GestureDetector DownCast(BaseHandle handle)
         {
-            GestureDetector ret = new GestureDetector(NDalicPINVOKE.GestureDetector_DownCast(BaseHandle.getCPtr(handle)), true);
+            GestureDetector ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as GestureDetector;
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index af70862..928305a 100755 (executable)
@@ -177,7 +177,7 @@ namespace Tizen.NUI
 
         public static Image DownCast(BaseHandle handle)
         {
-            Image ret = new Image(NDalicPINVOKE.Image_DownCast(BaseHandle.getCPtr(handle)), true);
+            Image ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as Image;
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index ab4fc20..ad354db 100755 (executable)
@@ -107,7 +107,7 @@ namespace Tizen.NUI
 
         internal new static ItemView DownCast(BaseHandle handle)
         {
-            ItemView ret = new ItemView(NDalicPINVOKE.ItemView_DownCast(BaseHandle.getCPtr(handle)), true);
+            ItemView ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as ItemView;
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 6004eb0..5a21f4c 100755 (executable)
@@ -162,7 +162,7 @@ namespace Tizen.NUI
         }
         internal new static LinearConstrainer DownCast(BaseHandle handle)
         {
-            LinearConstrainer ret = new LinearConstrainer(NDalicPINVOKE.LinearConstrainer_DownCast(BaseHandle.getCPtr(handle)), true);
+            LinearConstrainer ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as LinearConstrainer;
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 2262b85..a168ca7 100755 (executable)
@@ -177,7 +177,7 @@ namespace Tizen.NUI
         }
         public new static LongPressGestureDetector DownCast(BaseHandle handle)
         {
-            LongPressGestureDetector ret = new LongPressGestureDetector(NDalicPINVOKE.LongPressGestureDetector_DownCast(BaseHandle.getCPtr(handle)), true);
+            LongPressGestureDetector ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as LongPressGestureDetector;
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index b7e274b..cb053aa 100755 (executable)
@@ -187,7 +187,7 @@ namespace Tizen.NUI
 
         public new static Model3dView DownCast(BaseHandle handle)
         {
-            Model3dView ret = new Model3dView(NDalicPINVOKE.Model3dView_DownCast(BaseHandle.getCPtr(handle)), true);
+            Model3dView ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as Model3dView;
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 8303c3f..a3a6183 100755 (executable)
@@ -89,7 +89,7 @@ namespace Tizen.NUI
 
         public new static NativeImage DownCast(BaseHandle handle)
         {
-            NativeImage ret = new NativeImage(NDalicPINVOKE.NativeImage_DownCast(BaseHandle.getCPtr(handle)), true);
+            NativeImage ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as NativeImage;
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 84bba07..d2e501b 100755 (executable)
@@ -82,7 +82,7 @@ namespace Tizen.NUI
 
         public new static PageTurnLandscapeView DownCast(BaseHandle handle)
         {
-            PageTurnLandscapeView ret = new PageTurnLandscapeView(NDalicPINVOKE.PageTurnLandscapeView_DownCast(BaseHandle.getCPtr(handle)), true);
+            PageTurnLandscapeView ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as PageTurnLandscapeView;
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 0d2c174..607b476 100755 (executable)
@@ -82,7 +82,7 @@ namespace Tizen.NUI
 
         public new static PageTurnPortraitView DownCast(BaseHandle handle)
         {
-            PageTurnPortraitView ret = new PageTurnPortraitView(NDalicPINVOKE.PageTurnPortraitView_DownCast(BaseHandle.getCPtr(handle)), true);
+            PageTurnPortraitView ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as PageTurnPortraitView;
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 1203013..9a2ebbe 100755 (executable)
@@ -524,7 +524,7 @@ namespace Tizen.NUI
 
         public new static PageTurnView DownCast(BaseHandle handle)
         {
-            PageTurnView ret = new PageTurnView(NDalicPINVOKE.PageTurnView_DownCast(BaseHandle.getCPtr(handle)), true);
+            PageTurnView ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as PageTurnView;
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 178b6c2..2573744 100755 (executable)
@@ -343,7 +343,7 @@ namespace Tizen.NUI
         }
         public new static PanGestureDetector DownCast(BaseHandle handle)
         {
-            PanGestureDetector ret = new PanGestureDetector(NDalicPINVOKE.PanGestureDetector_DownCast(BaseHandle.getCPtr(handle)), true);
+            PanGestureDetector ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as PanGestureDetector;
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 9abb448..98e2d9e 100755 (executable)
@@ -166,7 +166,7 @@ namespace Tizen.NUI
         }
         public new static PathConstrainer DownCast(BaseHandle handle)
         {
-            PathConstrainer ret = new PathConstrainer(NDalicPINVOKE.PathConstrainer_DownCast(BaseHandle.getCPtr(handle)), true);
+            PathConstrainer ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as PathConstrainer;
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 34c31c7..449509f 100755 (executable)
@@ -170,7 +170,7 @@ namespace Tizen.NUI
         }
         public new static PinchGestureDetector DownCast(BaseHandle handle)
         {
-            PinchGestureDetector ret = new PinchGestureDetector(NDalicPINVOKE.PinchGestureDetector_DownCast(BaseHandle.getCPtr(handle)), true);
+            PinchGestureDetector ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as PinchGestureDetector;
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index d084ca1..50dc344 100755 (executable)
@@ -161,7 +161,7 @@ namespace Tizen.NUI
 
         public static PropertyNotification DownCast(BaseHandle handle)
         {
-            PropertyNotification ret = new PropertyNotification(NDalicPINVOKE.PropertyNotification_DownCast(BaseHandle.getCPtr(handle)), true);
+            PropertyNotification ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as PropertyNotification;
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 4964701..babb0ed 100755 (executable)
@@ -256,7 +256,7 @@ namespace Tizen.NUI
 
         public new static RenderTask DownCast(BaseHandle handle)
         {
-            RenderTask ret = new RenderTask(NDalicPINVOKE.RenderTask_DownCast(BaseHandle.getCPtr(handle)), true);
+            RenderTask ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as RenderTask;
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 250ba24..2c82275 100755 (executable)
@@ -71,7 +71,7 @@ namespace Tizen.NUI
 
         public static RenderTaskList DownCast(BaseHandle handle)
         {
-            RenderTaskList ret = new RenderTaskList(NDalicPINVOKE.RenderTaskList_DownCast(BaseHandle.getCPtr(handle)), true);
+            RenderTaskList ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as RenderTaskList;
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 7912eca..d710aa8 100755 (executable)
@@ -70,7 +70,7 @@ namespace Tizen.NUI
         }
         public static ScrollViewPagePathEffect DownCast(BaseHandle handle)
         {
-            ScrollViewPagePathEffect ret = new ScrollViewPagePathEffect(NDalicPINVOKE.ScrollViewPagePathEffect_DownCast(BaseHandle.getCPtr(handle)), true);
+            ScrollViewPagePathEffect ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as ScrollViewPagePathEffect;
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index a5908c4..a3c9c6e 100755 (executable)
@@ -172,7 +172,7 @@ namespace Tizen.NUI
         }
         public new static TapGestureDetector DownCast(BaseHandle handle)
         {
-            TapGestureDetector ret = new TapGestureDetector(NDalicPINVOKE.TapGestureDetector_DownCast(BaseHandle.getCPtr(handle)), true);
+            TapGestureDetector ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as TapGestureDetector;
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 03da8fd..956a3c6 100755 (executable)
@@ -151,7 +151,7 @@ namespace Tizen.NUI
             get
             {
                 global::System.IntPtr cPtr = NDalicPINVOKE.TouchPoint_hitActor_get(swigCPtr);
-                View ret = (cPtr == global::System.IntPtr.Zero) ? null : new View(cPtr, false);
+                View ret = (cPtr == global::System.IntPtr.Zero) ? null : Registry.GetManagedBaseHandleFromRefObject(cPtr) as View;
                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
                 return ret;
             }
index 1f3da0a..aea5d39 100755 (executable)
@@ -616,12 +616,22 @@ namespace Tizen.NUI
 
         private void SwigDirectorOnChildAdd(global::System.IntPtr child)
         {
-            OnChildAdd(new View(child, false));
+            View view = Registry.GetManagedBaseHandleFromNativePtr(child) as View;
+
+            if (view)
+            {
+                OnChildAdd(view);
+            }
         }
 
         private void SwigDirectorOnChildRemove(global::System.IntPtr child)
         {
-            OnChildRemove(new View(child, false));
+            View view = Registry.GetManagedBaseHandleFromNativePtr(child) as View;
+
+            if (view)
+            {
+                OnChildRemove(view);
+            }
         }
 
         private void SwigDirectorOnPropertySet(int index, global::System.IntPtr propertyValue)
@@ -676,7 +686,12 @@ namespace Tizen.NUI
 
         private float SwigDirectorCalculateChildSize(global::System.IntPtr child, int dimension)
         {
-            return CalculateChildSize(new View(child, false), (DimensionType)dimension);
+            View view = Registry.GetManagedBaseHandleFromNativePtr(child) as View;
+            if (view)
+            {
+                return CalculateChildSize(view, (DimensionType)dimension);
+            }
+            return 0.0f;
         }
 
         private float SwigDirectorGetHeightForWidth(float width)
@@ -716,17 +731,29 @@ namespace Tizen.NUI
 
         private void SwigDirectorOnControlChildAdd(global::System.IntPtr child)
         {
-            OnControlChildAdd(new View(child, false));
+            View view = Registry.GetManagedBaseHandleFromNativePtr(child) as View;
+            if (view)
+            {
+                OnControlChildAdd(view);
+            }
         }
 
         private void SwigDirectorOnControlChildRemove(global::System.IntPtr child)
         {
-            OnControlChildRemove(new View(child, false));
+            View view = Registry.GetManagedBaseHandleFromNativePtr(child) as View;
+            if (view)
+            {
+                OnControlChildRemove(view);
+            }
         }
 
         private void SwigDirectorOnStyleChange(global::System.IntPtr styleManager, int change)
         {
-            OnStyleChange(new StyleManager(styleManager, true), (StyleChangeType)change);
+            StyleManager stManager = Registry.GetManagedBaseHandleFromNativePtr(styleManager) as StyleManager;
+            if (stManager)
+            {
+                OnStyleChange(stManager, (StyleChangeType)change);
+            }
         }
 
         private bool SwigDirectorOnAccessibilityActivated()
@@ -766,12 +793,12 @@ namespace Tizen.NUI
 
         private global::System.IntPtr SwigDirectorGetNextKeyboardFocusableView(global::System.IntPtr currentFocusedView, int direction, bool loopEnabled)
         {
-            return View.getCPtr(GetNextFocusableView(new View(currentFocusedView, true), (View.FocusDirection)direction, loopEnabled)).Handle;
+            return View.getCPtr(GetNextFocusableView(Registry.GetManagedBaseHandleFromNativePtr(currentFocusedView) as View, (View.FocusDirection)direction, loopEnabled)).Handle;
         }
 
         private void SwigDirectorOnKeyboardFocusChangeCommitted(global::System.IntPtr commitedFocusableView)
         {
-            OnFocusChangeCommitted(new View(commitedFocusableView, true));
+            OnFocusChangeCommitted(Registry.GetManagedBaseHandleFromNativePtr(commitedFocusableView) as View);
         }
 
         private bool SwigDirectorOnKeyboardEnter()
index 81489de..94e182e 100755 (executable)
@@ -214,7 +214,9 @@ namespace Tizen.NUI
 
         public VisualBase GetVisual(int index)
         {
-            VisualBase ret = new VisualBase(NDalicManualPINVOKE.ViewWrapperImpl_GetVisual(swigCPtr, index), true);
+            System.IntPtr cPtr = NDalicManualPINVOKE.ViewWrapperImpl_GetVisual(swigCPtr, index);
+            VisualBase ret = Registry.GetManagedBaseHandleFromRefObject(cPtr) as VisualBase;
+
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
@@ -307,12 +309,20 @@ namespace Tizen.NUI
 
         private void DirectorOnChildAdd(global::System.IntPtr child)
         {
-            OnChildAdd(new View(child, false));
+            View view = Registry.GetManagedBaseHandleFromNativePtr(child) as View;
+            if (view)
+            {
+                OnChildAdd(view);
+            }
         }
 
         private void DirectorOnChildRemove(global::System.IntPtr child)
         {
-            OnChildRemove(new View(child, false));
+            View view = Registry.GetManagedBaseHandleFromNativePtr(child) as View;
+            if (view)
+            {
+                OnChildRemove(view);
+            }
         }
 
         private void DirectorOnPropertySet(int index, global::System.IntPtr propertyValue)
@@ -370,7 +380,12 @@ namespace Tizen.NUI
 
         private float DirectorCalculateChildSize(global::System.IntPtr child, int dimension)
         {
-            return CalculateChildSize(new View(child, false), (DimensionType)dimension);
+            View view = Registry.GetManagedBaseHandleFromNativePtr(child) as View;
+            if (view)
+            {
+                return CalculateChildSize(view, (DimensionType)dimension);
+            }
+            return 0.0f;
         }
 
         private float DirectorGetHeightForWidth(float width)
@@ -409,12 +424,20 @@ namespace Tizen.NUI
 
         private void DirectorOnControlChildAdd(global::System.IntPtr child)
         {
-            OnControlChildAdd(new View(child, false));
+            View view = Registry.GetManagedBaseHandleFromNativePtr(child) as View;
+            if (view)
+            {
+                OnControlChildAdd(view);
+            }
         }
 
         private void DirectorOnControlChildRemove(global::System.IntPtr child)
         {
-            OnControlChildRemove(new View(child, false));
+            View view = Registry.GetManagedBaseHandleFromNativePtr(child) as View;
+            if (view)
+            {
+                OnControlChildRemove(view);
+            }
         }
 
         private void DirectorOnStyleChange(global::System.IntPtr styleManager, int change)
@@ -462,12 +485,20 @@ namespace Tizen.NUI
 
         private global::System.IntPtr DirectorGetNextFocusableActor(global::System.IntPtr currentFocusedActor, int direction, bool loopEnabled)
         {
-            return View.getCPtr(GetNextFocusableView(new View(currentFocusedActor, false), (View.FocusDirection)direction, loopEnabled)).Handle;
+            View view = GetNextFocusableView(Registry.GetManagedBaseHandleFromNativePtr(currentFocusedActor) as View, (View.FocusDirection)direction, loopEnabled);
+            if (view)
+            {
+                return View.getCPtr(view).Handle;
+            }
+            else
+            {
+                return currentFocusedActor;
+            }
         }
 
         private void DirectorOnFocusChangeCommitted(global::System.IntPtr commitedFocusableView)
         {
-            OnFocusChangeCommitted(new View(commitedFocusableView, false));
+            OnFocusChangeCommitted(Registry.GetManagedBaseHandleFromNativePtr(commitedFocusableView) as View);
         }
 
         private bool DirectorOnKeyboardEnter()
index 83b129f..3169ad3 100755 (executable)
@@ -767,7 +767,7 @@ namespace Tizen.NUI
         /// <returns>Handle to an Animation object or an uninitialized handle</returns>
         public static Animation DownCast(BaseHandle handle)
         {
-            Animation ret = new Animation(NDalicPINVOKE.Animation_DownCast(BaseHandle.getCPtr(handle)), true);
+            Animation ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as Animation;
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 27be697..5182c4f 100755 (executable)
@@ -183,7 +183,7 @@ namespace Tizen.NUI.BaseComponents
         [Obsolete("Please do not use! this will be deprecated")]
         public new static ImageView DownCast(BaseHandle handle)
         {
-            ImageView ret = new ImageView(NDalicPINVOKE.ImageView_DownCast(BaseHandle.getCPtr(handle)), true);
+            ImageView ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as ImageView;
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 5744fc0..48b57d3 100755 (executable)
@@ -318,7 +318,7 @@ namespace Tizen.NUI.BaseComponents
         [Obsolete("Please do not use! this will be deprecated")]
         public new static TableView DownCast(BaseHandle handle)
         {
-            TableView ret = new TableView(NDalicPINVOKE.TableView_DownCast(BaseHandle.getCPtr(handle)), true);
+            TableView ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as TableView;
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
@@ -344,7 +344,9 @@ namespace Tizen.NUI.BaseComponents
         /// <returns>Child that was in the cell or an uninitialized handle</returns>
         public View GetChildAt(TableView.CellPosition position)
         {
-            View ret = new View(NDalicPINVOKE.TableView_GetChildAt(swigCPtr, TableView.CellPosition.getCPtr(position)), true);
+            IntPtr cPtr = NDalicPINVOKE.TableView_GetChildAt(swigCPtr, TableView.CellPosition.getCPtr(position));
+            View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View;
+
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
@@ -356,7 +358,9 @@ namespace Tizen.NUI.BaseComponents
         /// <returns>Child that was removed or an uninitialized handle</returns>
         public View RemoveChildAt(TableView.CellPosition position)
         {
-            View ret = new View(NDalicPINVOKE.TableView_RemoveChildAt(swigCPtr, TableView.CellPosition.getCPtr(position)), true);
+            IntPtr cPtr = NDalicPINVOKE.TableView_RemoveChildAt(swigCPtr, TableView.CellPosition.getCPtr(position));
+            View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View;
+
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 23d3165..288a477 100755 (executable)
@@ -315,7 +315,7 @@ namespace Tizen.NUI.BaseComponents
         [Obsolete("Please do not use! this will be deprecated")]
         public new static TextEditor DownCast(BaseHandle handle)
         {
-            TextEditor ret = new TextEditor(NDalicPINVOKE.TextEditor_DownCast(BaseHandle.getCPtr(handle)), true);
+            TextEditor ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as TextEditor;
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 7b896bc..bcf1a09 100755 (executable)
@@ -296,7 +296,7 @@ namespace Tizen.NUI.BaseComponents
         [Obsolete("Please do not use! this will be deprecated")]
         public new static TextField DownCast(BaseHandle handle)
         {
-            TextField ret = new TextField(NDalicPINVOKE.TextField_DownCast(BaseHandle.getCPtr(handle)), true);
+            TextField ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as TextField;
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index bc794d7..fe53cb7 100755 (executable)
@@ -131,7 +131,7 @@ namespace Tizen.NUI.BaseComponents
         [Obsolete("Please do not use! this will be deprecated")]
         public new static TextLabel DownCast(BaseHandle handle)
         {
-            TextLabel ret = new TextLabel(NDalicPINVOKE.TextLabel_DownCast(BaseHandle.getCPtr(handle)), true);
+            TextLabel ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as TextLabel;
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 7c380b9..0c8e0de 100755 (executable)
@@ -174,7 +174,7 @@ namespace Tizen.NUI.BaseComponents
         [Obsolete("Please do not use! this will be deprecated")]
         public new static VideoView DownCast(BaseHandle handle)
         {
-            VideoView ret = new VideoView(NDalicPINVOKE.VideoView_DownCast(BaseHandle.getCPtr(handle)), true);
+            VideoView ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as VideoView;
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 7646242..d0ddfee 100755 (executable)
@@ -820,28 +820,21 @@ namespace Tizen.NUI.BaseComponents
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
-        /// <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")]
+        [Obsolete("Please do not use! this will be deprecated, instead please us as keyword.")]
         public new static View DownCast(BaseHandle handle)
         {
-            View ret = new View(NDalicPINVOKE.View_DownCast(BaseHandle.getCPtr(handle)), true);
+            View ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as View;
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
 
-        [Obsolete("Please do not use! this will be deprecated")]
+        [Obsolete("Please do not use! this will be deprecated, instead please us as keyword.")]
         public static T DownCast<T>(View view) where T : View
         {
-            View ret = Registry.GetManagedBaseHandleFromNativePtr(view) as View;
+            T ret = Registry.GetManagedBaseHandleFromNativePtr(view) as T;
             if (ret != null)
             {
-                return (T)ret;
+                return ret;
             }
             return null;
         }
@@ -2021,7 +2014,9 @@ namespace Tizen.NUI.BaseComponents
 
         internal Layer GetLayer()
         {
-            Layer ret = new Layer(NDalicPINVOKE.Actor_GetLayer(swigCPtr), true);
+            IntPtr cPtr = NDalicPINVOKE.Actor_GetLayer(swigCPtr);
+            Layer ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Layer;
+
             if (NDalicPINVOKE.SWIGPendingException.Pending)
                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
@@ -2719,7 +2714,9 @@ namespace Tizen.NUI.BaseComponents
 
         public Renderer GetRendererAt(uint index)
         {
-            Renderer ret = new Renderer(NDalicPINVOKE.Actor_GetRendererAt(swigCPtr, index), true);
+            IntPtr cPtr = NDalicPINVOKE.Actor_GetRendererAt(swigCPtr, index);
+            Renderer ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Renderer;
+
             if (NDalicPINVOKE.SWIGPendingException.Pending)
                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
index f88b1ff..dc36895 100755 (executable)
@@ -104,7 +104,7 @@ namespace Tizen.NUI.BaseComponents
 
             if (visualIndex > 0)
             {
-                visual = VisualFactory.Get().CreateVisual(visualMap.OutputVisualMap); // Create a visual for the new one.
+                visual = VisualFactory.Instance.CreateVisual(visualMap.OutputVisualMap); // Create a visual for the new one.
                 visual.Name = visualName;
                 visual.DepthIndex = visualMap.DepthIndex;
 
@@ -190,7 +190,7 @@ namespace Tizen.NUI.BaseComponents
         {
             VisualBase visual = null;
 
-            visual = VisualFactory.Get().CreateVisual(visualMap.OutputVisualMap);
+            visual = VisualFactory.Instance.CreateVisual(visualMap.OutputVisualMap);
             visual.Name = visualName;
             visual.DepthIndex = visualMap.DepthIndex;
 
index f208769..cfed4a8 100755 (executable)
@@ -87,7 +87,7 @@ namespace Tizen.NUI
 
             // Create image visual for the arrow keys
             _arrowVisualPropertyIndex = RegisterProperty("ArrowImage", new PropertyValue(_arrowImage), Tizen.NUI.PropertyAccessMode.ReadWrite);
-            _arrowVisual = VisualFactory.Get().CreateVisual(
+            _arrowVisual = VisualFactory.Instance.CreateVisual(
                 new PropertyMap().Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Image))
                                  .Add(ImageVisualProperty.URL, new PropertyValue(_arrowImage))
                                  .Add(ImageVisualProperty.DesiredHeight, new PropertyValue(150))
@@ -187,9 +187,8 @@ namespace Tizen.NUI
             }
             else
             {
-                // Return a native empty handle as nothing can be focused in the left or right
-                nextFocusedView = new View();
-                nextFocusedView.Reset();
+                // Return null
+                return null;
             }
 
             return nextFocusedView;
@@ -378,7 +377,7 @@ namespace Tizen.NUI
             set
             {
                 _arrowImage = value;
-                _arrowVisual = VisualFactory.Get().CreateVisual(
+                _arrowVisual = VisualFactory.Instance.CreateVisual(
                     new PropertyMap().Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Image))
                                  .Add(ImageVisualProperty.URL, new PropertyValue(_arrowImage))
                                  .Add(ImageVisualProperty.DesiredHeight, new PropertyValue(150))
index 8b58ce5..92abafb 100755 (executable)
@@ -105,7 +105,7 @@ namespace Tizen.NUI
         [Obsolete("Please do not use! this will be deprecated")]
         public static KeyFrames DownCast(BaseHandle handle)
         {
-            KeyFrames ret = new KeyFrames(NDalicPINVOKE.KeyFrames_DownCast(BaseHandle.getCPtr(handle)), true);
+            KeyFrames ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as KeyFrames;
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 474146c..17179f8 100755 (executable)
@@ -103,7 +103,7 @@ namespace Tizen.NUI
         [Obsolete("Please do not use! this will be deprecated")]
         public new static Layer DownCast(BaseHandle handle)
         {
-            Layer ret = new Layer(NDalicPINVOKE.Layer_DownCast(BaseHandle.getCPtr(handle)), true);
+            Layer ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as Layer;
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
@@ -117,7 +117,9 @@ namespace Tizen.NUI
         /// <returns> A handle to the view if found, or an empty handle if not. </returns>
         public View FindChildById(uint id)
         {
-            View ret = new View(NDalicPINVOKE.Actor_FindChildById(swigCPtr, id), true);
+            IntPtr cPtr = NDalicPINVOKE.Actor_FindChildById(swigCPtr, id);
+            View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View;
+
             if (NDalicPINVOKE.SWIGPendingException.Pending)
                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
index 4090eaa..a13eb6a 100755 (executable)
@@ -88,7 +88,7 @@ namespace Tizen.NUI
         [Obsolete("Please do not use! this will be deprecated")]
         public new static Path DownCast(BaseHandle handle)
         {
-            Path ret = new Path(NDalicPINVOKE.Path_DownCast(BaseHandle.getCPtr(handle)), true);
+            Path ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as Path;
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index d875000..6ff2db2 100755 (executable)
@@ -107,7 +107,9 @@ namespace Tizen.NUI
 
         public Geometry GetGeometry()
         {
-            Geometry ret = new Geometry(NDalicPINVOKE.Renderer_GetGeometry(swigCPtr), true);
+            System.IntPtr cPtr = NDalicPINVOKE.Renderer_GetGeometry(swigCPtr);
+            Geometry ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Geometry;
+
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
@@ -126,7 +128,9 @@ namespace Tizen.NUI
 
         public TextureSet GetTextures()
         {
-            TextureSet ret = new TextureSet(NDalicPINVOKE.Renderer_GetTextures(swigCPtr), true);
+            System.IntPtr cPtr = NDalicPINVOKE.Renderer_GetTextures(swigCPtr);
+            TextureSet ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as TextureSet;
+
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
@@ -139,7 +143,9 @@ namespace Tizen.NUI
 
         public Shader GetShader()
         {
-            Shader ret = new Shader(NDalicPINVOKE.Renderer_GetShader(swigCPtr), true);
+            System.IntPtr cPtr = NDalicPINVOKE.Renderer_GetShader(swigCPtr);
+            Shader ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Shader;
+
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index c7ee739..cbb0394 100755 (executable)
@@ -78,7 +78,9 @@ namespace Tizen.NUI
 
         public Texture GetTexture(uint index)
         {
-            Texture ret = new Texture(NDalicPINVOKE.TextureSet_GetTexture(swigCPtr, index), true);
+            System.IntPtr cPtr = NDalicPINVOKE.TextureSet_GetTexture(swigCPtr, index);
+            Texture ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Texture;
+
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
@@ -91,7 +93,9 @@ namespace Tizen.NUI
 
         public Sampler GetSampler(uint index)
         {
-            Sampler ret = new Sampler(NDalicPINVOKE.TextureSet_GetSampler(swigCPtr, index), true);
+            System.IntPtr cPtr = NDalicPINVOKE.TextureSet_GetSampler(swigCPtr, index);
+            Sampler ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Sampler;
+
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 8229740..41c9b7a 100755 (executable)
@@ -145,7 +145,7 @@ namespace Tizen.NUI
         [Obsolete("Please do not use! this will be deprecated")]
         public static Timer DownCast(BaseHandle handle)
         {
-            Timer ret = new Timer(NDalicPINVOKE.Timer_DownCast(BaseHandle.getCPtr(handle)), true);
+            Timer ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as Timer;
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index a547720..a181fb5 100755 (executable)
@@ -70,7 +70,12 @@ namespace Tizen.NUI
 
         internal static Touch GetTouchFromPtr(global::System.IntPtr cPtr)
         {
-            Touch ret = new Touch(cPtr, false);
+            Touch ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Touch;
+            if (ret == null)
+            {
+                ret = new Touch(cPtr, false);
+            }
+
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
@@ -147,7 +152,9 @@ namespace Tizen.NUI
         /// <returns>The actor that was underneath the point specified</returns>
         public View GetHitView(uint point)
         {
-            View ret = new View(NDalicPINVOKE.Touch_GetHitActor(swigCPtr, point), true);
+            global::System.IntPtr cPtr = NDalicPINVOKE.Touch_GetHitActor(swigCPtr, point);
+            View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View;
+
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 1a933a4..24a606d 100755 (executable)
@@ -352,7 +352,7 @@ namespace Tizen.NUI.UIComponents
         [Obsolete("Please do not use! this will be deprecated")]
         public new static Popup DownCast(BaseHandle handle)
         {
-            Popup ret = new Popup(NDalicPINVOKE.Popup_DownCast(BaseHandle.getCPtr(handle)), true);
+            Popup ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as Popup;
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
@@ -369,7 +369,9 @@ namespace Tizen.NUI.UIComponents
 
         internal View GetTitle()
         {
-            View ret = new View(NDalicPINVOKE.Popup_GetTitle(swigCPtr), true);
+            IntPtr cPtr = NDalicPINVOKE.Popup_GetTitle(swigCPtr);
+            View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View;
+
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
@@ -386,7 +388,9 @@ namespace Tizen.NUI.UIComponents
 
         internal View GetContent()
         {
-            View ret = new View(NDalicPINVOKE.Popup_GetContent(swigCPtr), true);
+            IntPtr cPtr = NDalicPINVOKE.Popup_GetContent(swigCPtr);
+            View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View;
+
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
@@ -403,7 +407,9 @@ namespace Tizen.NUI.UIComponents
 
         internal View GetFooter()
         {
-            View ret = new View(NDalicPINVOKE.Popup_GetFooter(swigCPtr), true);
+            IntPtr cPtr = NDalicPINVOKE.Popup_GetFooter(swigCPtr);
+            View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View;
+
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 39bd34c..4c8ee8e 100755 (executable)
@@ -93,7 +93,7 @@ namespace Tizen.NUI.UIComponents
         [Obsolete("Please do not use! this will be deprecated")]
         public new static PushButton DownCast(BaseHandle handle)
         {
-            PushButton ret = new PushButton(NDalicPINVOKE.PushButton_DownCast(BaseHandle.getCPtr(handle)), true);
+            PushButton ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as PushButton;
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index d1d619f..51417f2 100755 (executable)
@@ -225,7 +225,7 @@ namespace Tizen.NUI.UIComponents
         [Obsolete("Please do not use! this will be deprecated")]
         public new static ScrollBar DownCast(BaseHandle handle)
         {
-            ScrollBar ret = new ScrollBar(NDalicPINVOKE.ScrollBar_DownCast(BaseHandle.getCPtr(handle)), true);
+            ScrollBar ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as ScrollBar;
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 6783fe0..a7d6882 100755 (executable)
@@ -474,7 +474,7 @@ namespace Tizen.NUI.UIComponents
         /// <returns>Handle to a Slider or an uninitialized handle</returns>
         public new static Slider DownCast(BaseHandle handle)
         {
-            Slider ret = new Slider(NDalicPINVOKE.Slider_DownCast(BaseHandle.getCPtr(handle)), true);
+            Slider ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as Slider;
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 9c6e7c2..5d40948 100755 (executable)
@@ -70,7 +70,7 @@ namespace Tizen.NUI
         /// Create or retrieve VisualFactory singleton.
         /// </summary>
         /// <returns>A handle to the VisualFactory control.</returns>
-        public static VisualFactory Get()
+        private static VisualFactory Get()
         {
             VisualFactory ret = new VisualFactory(NDalicPINVOKE.VisualFactory_Get(), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
index 793e1a5..6a1e21a 100755 (executable)
@@ -558,7 +558,9 @@ namespace Tizen.NUI
 
         public Layer GetLayer(uint depth)
         {
-            Layer ret = new Layer(NDalicPINVOKE.Stage_GetLayer(stageCPtr, depth), true);
+            IntPtr cPtr = NDalicPINVOKE.Stage_GetLayer(stageCPtr, depth);
+            Layer ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Layer;
+
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
@@ -661,7 +663,7 @@ namespace Tizen.NUI
 
         internal ResizedSignal ResizedSignal()
         {
-            ResizedSignal ret = new ResizedSignal(NDalicManualPINVOKE.Window_ResizedSignal(stageCPtr), false);
+            ResizedSignal ret = new ResizedSignal(NDalicManualPINVOKE.Window_ResizedSignal(swigCPtr), false);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
@@ -1179,7 +1181,7 @@ namespace Tizen.NUI
 
         private WindowResizedEventCallbackType _windowResizedEventCallback;
         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
-        private delegate void WindowResizedEventCallbackType(Size2D windowSize);
+        private delegate void WindowResizedEventCallbackType(IntPtr windowSize);
         private event EventHandler<ResizedEventArgs> _windowResizedEventHandler;
 
         public event EventHandler<ResizedEventArgs> Resized
@@ -1205,10 +1207,12 @@ namespace Tizen.NUI
             }
         }
 
-        private void OnResized(Size2D windowSize)
+        private void OnResized(IntPtr windowSize)
         {
             ResizedEventArgs e = new ResizedEventArgs();
-            e.WindowSize = windowSize;
+            var val = new Uint16Pair(windowSize, false);
+            e.WindowSize = new Size2D(val.GetWidth(), val.GetHeight());
+            val.Dispose();
 
             if (_windowResizedEventHandler != null)
             {
@@ -1224,7 +1228,10 @@ namespace Tizen.NUI
 
         internal Size2D GetWindowSize()
         {
-            Size2D ret = new Size2D(NDalicManualPINVOKE.GetSize(swigCPtr), true);
+            var val = new Uint16Pair(NDalicManualPINVOKE.GetSize(swigCPtr), false);
+            Size2D ret = new Size2D(val.GetWidth(), val.GetHeight());
+            val.Dispose();
+
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }