Add Toggled event in Panel
authorSeungkeun Lee <sngn.lee@samsung.com>
Wed, 21 Sep 2016 05:09:22 +0000 (14:09 +0900)
committerSeungkeun Lee <sngn.lee@samsung.com>
Wed, 21 Sep 2016 05:22:33 +0000 (14:22 +0900)
 - Please latest binary to test Toggled event (after 9/4)

Change-Id: I0d28e05cfe29f02e2fc84f2ed68467fbebc9dadf

src/ElmSharp/ElmSharp/Panel.cs
test/ElmSharp.Test/TC/PanelTest1.cs
test/ElmSharp.Test/TC/PanelTest2.cs

index fa3ae2d..269be16 100644 (file)
@@ -28,8 +28,11 @@ namespace ElmSharp
 
     public class Panel : Layout
     {
+        Interop.SmartEvent _toggled;
         public Panel(EvasObject parent) : base(parent)
         {
+            _toggled = new Interop.SmartEvent(this, Handle, "toggled");
+            _toggled.On += (s, e) => Toggled?.Invoke(this, EventArgs.Empty);
         }
 
         public bool IsOpen
@@ -56,6 +59,8 @@ namespace ElmSharp
             }
         }
 
+        public event EventHandler Toggled;
+
         public void SetScrollable(bool enable)
         {
             Interop.Elementary.elm_panel_scrollable_set(Handle, enable);
index bf05380..5ebd7c7 100644 (file)
@@ -76,6 +76,10 @@ namespace ElmSharp.Test
             {
                 panel.Direction = (PanelDirection)((int)(panel.Direction+1) % 4);
             };
+            panel.Toggled += (s, e) =>
+            {
+                Console.WriteLine("Panel Toggled!");
+            };
         }
         
     }
index a06edc1..e7fc859 100644 (file)
@@ -77,6 +77,10 @@ namespace ElmSharp.Test
             {
                 panel.Direction = (PanelDirection)((int)(panel.Direction + 1) % 4);
             };
+            panel.Toggled += (s, e) =>
+            {
+                Console.WriteLine("Panel Toggled!");
+            };
         }
 
     }