From: Lukasz Foniok Date: Thu, 20 Oct 2016 16:14:41 +0000 (+0200) Subject: First and Last item property X-Git-Tag: accepted/tizen/mobile/20161214.085942~33 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1179f584d52cfd1d9e62682a29cf1dcadb615ebe;p=platform%2Fcore%2Fcsapi%2Felm-sharp.git First and Last item property Change-Id: If550f20af5c9f12e776981cab7a6034f4e0f22f7 Signed-off-by: Lukasz Foniok --- diff --git a/ElmSharp/ElmSharp/GenList.cs b/ElmSharp/ElmSharp/GenList.cs index 0b8c118..9860305 100644 --- a/ElmSharp/ElmSharp/GenList.cs +++ b/ElmSharp/ElmSharp/GenList.cs @@ -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 ItemSelected; public event EventHandler ItemUnselected; public event EventHandler ItemPressed; diff --git a/ElmSharp/Interop/Interop.Elementary.GenListView.cs b/ElmSharp/Interop/Interop.Elementary.GenListView.cs index ca82bdc..161da8f 100644 --- a/ElmSharp/Interop/Interop.Elementary.GenListView.cs +++ b/ElmSharp/Interop/Interop.Elementary.GenListView.cs @@ -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)]