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 that 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)
35 InitializeItem(handle, content);
38 NaviItem(IntPtr handle, EvasObject content, EvasObject parent) : base(handle, parent)
40 InitializeItem(handle, content);
43 void InitializeItem(IntPtr handle, EvasObject content)
50 Popped?.Invoke(this, EventArgs.Empty);
53 Interop.Elementary.elm_naviframe_item_pop_cb_set(handle, _popped, IntPtr.Zero);
57 /// Popped will be triggered when NaviItem is removed.
59 /// <since_tizen> preview </since_tizen>
60 public event EventHandler Popped;
63 /// Gets the content object. The name of the content part is "elm.swallow.content".
65 /// <since_tizen> preview </since_tizen>
66 public EvasObject Content
68 get { return _content; }
72 /// Sets or gets a value whether the title area is enabled or not.
74 /// <since_tizen> preview </since_tizen>
75 public bool TitleBarVisible
79 return Interop.Elementary.elm_naviframe_item_title_enabled_get(Handle);
83 Interop.Elementary.elm_naviframe_item_title_enabled_set(Handle, value, false);
88 /// Sets or gets the title bar background color.
90 /// <since_tizen> preview </since_tizen>
91 public Color TitleBarBackgroundColor
95 return _barBackgroundColor;
101 Interop.Elementary.elm_object_item_color_class_del(Handle, "bg_title");
105 SetPartColor("bg_title", value);
106 _barBackgroundColor = value;
112 /// Sets or gets an item style.
114 /// <since_tizen> preview </since_tizen>
115 public override string Style
119 return Interop.Elementary.elm_naviframe_item_style_get(Handle);
123 Interop.Elementary.elm_naviframe_item_style_set(Handle, value);
128 /// Invalidates the EventArgs if _isPopped is false.
129 /// The method should be overridden in the children class.
131 /// <since_tizen> preview </since_tizen>
132 protected override void OnInvalidate()
135 Popped?.Invoke(this, EventArgs.Empty);
138 internal static NaviItem FromNativeHandle(IntPtr handle, EvasObject content, EvasObject parent)
140 return new NaviItem(handle, content, parent);