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, "language,changed");
31 _languageChanged.On += (s, e) => {
32 LanguageChanged?.Invoke(this, EventArgs.Empty);
35 _themeChanged = new SmartEvent(this, "theme,changed");
36 _themeChanged.On += (s, e) =>
38 ThemeChanged?.Invoke(this, EventArgs.Empty);
42 public event EventHandler LanguageChanged;
44 public event EventHandler ThemeChanged;
46 public EdjeObject EdjeObject
50 if (_edjeHandle == IntPtr.Zero)
51 _edjeHandle = Interop.Elementary.elm_layout_edje_get(Handle);
52 return new EdjeObject(_edjeHandle);
56 public void SetTheme(string klass, string group, string style)
58 Interop.Elementary.elm_layout_theme_set(Handle, klass, group, style);
61 public void SetFile(string file, string group)
63 Interop.Elementary.elm_layout_file_set(Handle, file, group);
66 public override Color BackgroundColor
72 string part = ClassName.ToLower().Replace("elm_", "") + "/" + "bg";
73 EdjeObject.DeleteColorClass(part);
77 SetPartColor("bg", value);
79 _backgroundColor = value;
83 protected override IntPtr CreateHandle(EvasObject parent)
85 return Interop.Elementary.elm_layout_add(parent.Handle);