2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
22 /// The NaviItem is a widget to contain the contents to show in Naviframe.
23 /// Inherits ItemObject
25 public class NaviItem : ItemObject
29 Color _barBackgroundColor = Color.Default;
30 Interop.Elementary.Elm_Naviframe_Item_Pop_Cb _popped;
32 NaviItem(IntPtr handle, EvasObject content) : base(handle)
39 Popped?.Invoke(this, EventArgs.Empty);
42 Interop.Elementary.elm_naviframe_item_pop_cb_set(handle, _popped, IntPtr.Zero);
46 /// Popped will be triggered when NaviItem is removed.
48 public event EventHandler Popped;
51 /// Gets the content object. The name of content part is "elm.swallow.content".
53 public EvasObject Content
55 get { return _content; }
59 /// Sets or gets a value whether title area is enabled or not.
61 public bool TitleBarVisible
65 return Interop.Elementary.elm_naviframe_item_title_enabled_get(Handle);
69 Interop.Elementary.elm_naviframe_item_title_enabled_set(Handle, value, false);
74 /// Sets or gets the title bar background color
76 public Color TitleBarBackgroundColor
80 return _barBackgroundColor;
86 Interop.Elementary.elm_object_item_color_class_del(Handle, "bg_title");
90 SetPartColor("bg_title", value);
91 _barBackgroundColor = value;
97 /// Sets or gets an item style.
103 return Interop.Elementary.elm_naviframe_item_style_get(Handle);
107 Interop.Elementary.elm_naviframe_item_style_set(Handle, value);
112 /// Invalidate the EventArgs if _isPopped is false.
113 /// The method should be overridden in children class.
115 protected override void OnInvalidate()
118 Popped?.Invoke(this, EventArgs.Empty);
121 internal static NaviItem FromNativeHandle(IntPtr handle, EvasObject content)
123 return new NaviItem(handle, content);