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 /// <since_tizen> preview </since_tizen>
26 public class NaviItem : ItemObject
30 Color _barBackgroundColor = Color.Default;
31 Interop.Elementary.Elm_Naviframe_Item_Pop_Cb _popped;
33 NaviItem(IntPtr handle, EvasObject content) : base(handle)
40 Popped?.Invoke(this, EventArgs.Empty);
43 Interop.Elementary.elm_naviframe_item_pop_cb_set(handle, _popped, IntPtr.Zero);
47 /// Popped will be triggered when NaviItem is removed.
49 /// <since_tizen> preview </since_tizen>
50 public event EventHandler Popped;
53 /// Gets the content object. The name of content part is "elm.swallow.content".
55 /// <since_tizen> preview </since_tizen>
56 public EvasObject Content
58 get { return _content; }
62 /// Sets or gets a value whether title area is enabled or not.
64 /// <since_tizen> preview </since_tizen>
65 public bool TitleBarVisible
69 return Interop.Elementary.elm_naviframe_item_title_enabled_get(Handle);
73 Interop.Elementary.elm_naviframe_item_title_enabled_set(Handle, value, false);
78 /// Sets or gets the title bar background color
80 /// <since_tizen> preview </since_tizen>
81 public Color TitleBarBackgroundColor
85 return _barBackgroundColor;
91 Interop.Elementary.elm_object_item_color_class_del(Handle, "bg_title");
95 SetPartColor("bg_title", value);
96 _barBackgroundColor = value;
102 /// Sets or gets an item style.
104 /// <since_tizen> preview </since_tizen>
105 public override string Style
109 return Interop.Elementary.elm_naviframe_item_style_get(Handle);
113 Interop.Elementary.elm_naviframe_item_style_set(Handle, value);
118 /// Invalidate the EventArgs if _isPopped is false.
119 /// The method should be overridden in children class.
121 /// <since_tizen> preview </since_tizen>
122 protected override void OnInvalidate()
125 Popped?.Invoke(this, EventArgs.Empty);
128 internal static NaviItem FromNativeHandle(IntPtr handle, EvasObject content)
130 return new NaviItem(handle, content);