[NUI] Fix comments according to document review
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / XamlBinding / Trigger.cs
1 /*
2  * Copyright(c) 2021 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17
18 using System;
19 using System.Collections.Generic;
20 using System.ComponentModel;
21
22 using Tizen.NUI.Xaml;
23
24 namespace Tizen.NUI.Binding
25 {
26     /// <since_tizen> 6 </since_tizen>
27     /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
28     [EditorBrowsable(EditorBrowsableState.Never)]
29     [ContentProperty("Setters")]
30     [ProvideCompiled("Tizen.NUI.Xaml.Core.XamlC.PassthroughValueProvider")]
31     [AcceptEmptyServiceProvider]
32     public sealed class Trigger : TriggerBase, IValueProvider
33     {
34         /// <since_tizen> 6 </since_tizen>
35         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
36         [EditorBrowsable(EditorBrowsableState.Never)]
37         public Trigger([TypeConverter(typeof(TypeTypeConverter))][Parameter("TargetType")] Type targetType) : base(new XamlPropertyCondition(), targetType)
38         {
39         }
40
41         /// <since_tizen> 6 </since_tizen>
42         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
43         [EditorBrowsable(EditorBrowsableState.Never)]
44         public BindableProperty Property
45         {
46             get { return ((XamlPropertyCondition)Condition).Property; }
47             set
48             {
49                 if (((XamlPropertyCondition)Condition).Property == value)
50                     return;
51                 if (IsSealed)
52                     throw new InvalidOperationException("Can not change Property once the Trigger has been applied.");
53                 OnPropertyChanging();
54                 ((XamlPropertyCondition)Condition).Property = value;
55                 OnPropertyChanged();
56             }
57         }
58
59         /// <since_tizen> 6 </since_tizen>
60         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
61         [EditorBrowsable(EditorBrowsableState.Never)]
62         public new IList<Setter> Setters
63         {
64             get { return base.Setters; }
65         }
66
67         /// <since_tizen> 6 </since_tizen>
68         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
69         [EditorBrowsable(EditorBrowsableState.Never)]
70         [Obsolete("This has been deprecated in API9 and will be removed in API11. Use GetValue() instead.")]
71         public object Value
72         {
73             get { return ((XamlPropertyCondition)Condition).Value; }
74             set
75             {
76                 if (((XamlPropertyCondition)Condition).Value == value)
77                     return;
78                 if (IsSealed)
79                     throw new InvalidOperationException("Can not change Value once the Trigger has been applied.");
80                 OnPropertyChanging();
81                 ((XamlPropertyCondition)Condition).Value = value;
82                 OnPropertyChanged();
83             }
84         }
85
86         object IValueProvider.ProvideValue(IServiceProvider serviceProvider)
87         {
88             //This is no longer required
89             return this;
90         }
91     }
92 }