First and Last item property
authorLukasz Foniok <l.foniok@samsung.com>
Thu, 20 Oct 2016 16:14:41 +0000 (18:14 +0200)
committerLukasz Foniok <l.foniok@samsung.com>
Mon, 24 Oct 2016 12:13:50 +0000 (14:13 +0200)
Change-Id: If550f20af5c9f12e776981cab7a6034f4e0f22f7
Signed-off-by: Lukasz Foniok <l.foniok@samsung.com>
ElmSharp/ElmSharp/GenList.cs
ElmSharp/Interop/Interop.Elementary.GenListView.cs

index 0b8c118..9860305 100644 (file)
@@ -85,6 +85,24 @@ namespace ElmSharp
             }
         }
 
+        public GenListItem FirstItem
+        {
+            get
+            {
+                IntPtr handle = Interop.Elementary.elm_genlist_first_item_get(Handle);
+                return ItemObject.GetItemByHandle(handle) as GenListItem;
+            }
+        }
+
+        public GenListItem LastItem
+        {
+            get
+            {
+                IntPtr handle = Interop.Elementary.elm_genlist_last_item_get(Handle);
+                return ItemObject.GetItemByHandle(handle) as GenListItem;
+            }
+        }
+
         public event EventHandler<GenListItemEventArgs> ItemSelected;
         public event EventHandler<GenListItemEventArgs> ItemUnselected;
         public event EventHandler<GenListItemEventArgs> ItemPressed;
index ca82bdc..161da8f 100644 (file)
@@ -105,6 +105,9 @@ internal static partial class Interop
         internal static extern IntPtr elm_genlist_first_item_get(IntPtr obj);
 
         [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_genlist_last_item_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
         internal static extern bool elm_genlist_item_selected_get(IntPtr obj);
 
         [DllImport(Libraries.Elementary)]