[NUI] Change GetDefaultWindow() to static func (#900)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / XamlBinding / Interactivity / Condition.cs
1 using System;
2 using System.ComponentModel;
3
4 namespace Tizen.NUI.Binding
5 {
6     /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
7     [EditorBrowsable(EditorBrowsableState.Never)]
8     public abstract class Condition
9     {
10         Action<BindableObject, bool, bool> _conditionChanged;
11
12         bool _isSealed;
13
14         internal Condition()
15         {
16         }
17
18         internal Action<BindableObject, bool, bool> ConditionChanged
19         {
20             get { return _conditionChanged; }
21             set
22             {
23                 if (_conditionChanged == value)
24                     return;
25                 if (_conditionChanged != null)
26                     throw new InvalidOperationException("The same condition instance can not be reused");
27                 _conditionChanged = value;
28             }
29         }
30
31         internal bool IsSealed
32         {
33             get { return _isSealed; }
34             set
35             {
36                 if (_isSealed == value)
37                     return;
38                 if (!value)
39                     throw new InvalidOperationException("What is sealed can not be unsealed.");
40                 _isSealed = value;
41                 OnSealed();
42             }
43         }
44
45         internal abstract bool GetState(BindableObject bindable);
46
47         internal virtual void OnSealed()
48         {
49         }
50
51         internal abstract void SetUp(BindableObject bindable);
52         internal abstract void TearDown(BindableObject bindable);
53     }
54 }