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 Check is a widget that allows for toggling a value between true and false.
24 /// <since_tizen> preview </since_tizen>
25 [Obsolete("This has been deprecated in API12")]
26 public class Check : Layout
28 private SmartEvent _changed;
29 private bool _currentState;
32 /// Creates and initializes a new instance of the Check class.
34 /// <param name="parent">
35 /// The EvasObject to which the new check will be attached as a child.
37 /// <since_tizen> preview </since_tizen>
38 [Obsolete("This has been deprecated in API12")]
39 public Check(EvasObject parent) : base(parent)
41 _changed = new SmartEvent(this, this.RealHandle, "changed");
42 _changed.On += (sender, e) =>
44 StateChanged?.Invoke(this, new CheckStateChangedEventArgs(_currentState, IsChecked));
49 /// StateChanged will be triggered when the IsChecked in the check is changed.
51 /// <since_tizen> preview </since_tizen>
52 [Obsolete("This has been deprecated in API12")]
53 public event EventHandler<CheckStateChangedEventArgs> StateChanged;
56 /// Sets or gets whether the given check is checked or not.
59 /// When an object is checked, the value will be set to true. Conversely, will be set to false.
61 /// <since_tizen> preview </since_tizen>
62 [Obsolete("This has been deprecated in API12")]
67 _currentState = Interop.Elementary.elm_check_state_get(RealHandle);
72 Interop.Elementary.elm_check_state_set(RealHandle, value);
77 /// Creates a widget handle.
79 /// <param name="parent">Parent EvasObject.</param>
80 /// <returns>Handle IntPtr.</returns>
81 /// <since_tizen> preview </since_tizen>
82 [Obsolete("This has been deprecated in API12")]
83 protected override IntPtr CreateHandle(EvasObject parent)
85 IntPtr handle = Interop.Elementary.elm_layout_add(parent.Handle);
86 Interop.Elementary.elm_layout_theme_set(handle, "layout", "elm_widget", "default");
88 RealHandle = Interop.Elementary.elm_check_add(handle);
89 Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle);