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 class Layout : Widget
23 SmartEvent _languageChanged;
24 SmartEvent _themeChanged;
28 public Layout(EvasObject parent) : base(parent)
30 _languageChanged = new SmartEvent(this, this.RealHandle, "language,changed");
31 _languageChanged.On += (s, e) =>
33 LanguageChanged?.Invoke(this, EventArgs.Empty);
36 _themeChanged = new SmartEvent(this, this.RealHandle, "theme,changed");
37 _themeChanged.On += (s, e) =>
39 ThemeChanged?.Invoke(this, EventArgs.Empty);
43 public event EventHandler LanguageChanged;
45 public event EventHandler ThemeChanged;
47 public EdjeObject EdjeObject
51 if (_edjeHandle == IntPtr.Zero)
52 _edjeHandle = Interop.Elementary.elm_layout_edje_get(RealHandle);
53 return new EdjeObject(_edjeHandle);
57 public void SetTheme(string klass, string group, string style)
59 Interop.Elementary.elm_layout_theme_set(RealHandle, klass, group, style);
62 public void SetFile(string file, string group)
64 Interop.Elementary.elm_layout_file_set(RealHandle, file, group);
67 public override Color BackgroundColor
73 string part = ClassName.ToLower().Replace("elm_", "") + "/" + "bg";
74 EdjeObject.DeleteColorClass(part);
78 SetPartColor("bg", value);
80 _backgroundColor = value;
84 protected override IntPtr CreateHandle(EvasObject parent)
86 return Interop.Elementary.elm_layout_add(parent.Handle);