Change EvasObject's API visibility to protected from internal.
[platform/core/csapi/tizenfx.git] / src / ElmSharp / ElmSharp / Check.cs
1 using System;
2
3 namespace ElmSharp
4 {
5     public class Check : Layout
6     {
7         private Interop.SmartEvent _changed;
8         private bool _currentState;
9
10         public Check(EvasObject parent) : base(parent)
11         {
12             _changed = new Interop.SmartEvent(this, Handle, "changed");
13             _changed.On += (sender, e) =>
14             {
15                 StateChanged?.Invoke(this, new CheckStateChangedEventArgs(_currentState, IsChecked));
16             };
17         }
18
19         public event EventHandler<CheckStateChangedEventArgs> StateChanged;
20
21         public bool IsChecked
22         {
23             get
24             {
25                 _currentState = Interop.Elementary.elm_check_state_get(Handle);
26                 return _currentState;
27             }
28             set
29             {
30                 Interop.Elementary.elm_check_state_set(Handle, value);
31             }
32         }
33
34         protected override IntPtr CreateHandle(EvasObject parent)
35         {
36             return Interop.Elementary.elm_check_add(parent.Handle);
37         }
38     }
39 }