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.
21 public enum PanelDirection
41 public class Panel : Layout
44 public Panel(EvasObject parent) : base(parent)
46 _toggled = new SmartEvent(this, this.RealHandle, "toggled");
47 _toggled.On += (s, e) => Toggled?.Invoke(this, EventArgs.Empty);
54 return !Interop.Elementary.elm_panel_hidden_get(RealHandle);
58 Interop.Elementary.elm_panel_hidden_set(RealHandle, !value);
62 public PanelDirection Direction
66 return (PanelDirection)Interop.Elementary.elm_panel_orient_get(RealHandle);
70 Interop.Elementary.elm_panel_orient_set(RealHandle, (int)value);
74 public event EventHandler Toggled;
76 public void SetScrollable(bool enable)
78 Interop.Elementary.elm_panel_scrollable_set(RealHandle, enable);
81 public void SetScrollableArea(double ratio)
83 Interop.Elementary.elm_panel_scrollable_content_size_set(RealHandle, ratio);
88 Interop.Elementary.elm_panel_toggle(RealHandle);
91 protected override IntPtr CreateHandle(EvasObject parent)
93 IntPtr handle = Interop.Elementary.elm_layout_add(parent);
94 Interop.Elementary.elm_layout_theme_set(handle, "layout", "elm_widget", "default");
96 RealHandle = Interop.Elementary.elm_panel_add(handle);
97 Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle);