2 * Copyright(c) 2019 Samsung Electronics Co., Ltd.
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.
17 using System.ComponentModel;
18 using Tizen.NUI.BaseComponents;
20 namespace Tizen.NUI.Components
23 /// RadioButton is the Class that describe the control which can be checked, but not cleared by a user.
26 /// RadioButton radio = new RadioButton("C_RadioButton_WhiteText");
27 /// radio.Size = new Size(200, 64, 0);
28 /// radio.Position = new Position(500, posY, 0);
29 /// radio.Text = "RadioButton";
30 /// radio.Focusable = true;
32 /// <since_tizen> 8 </since_tizen>
33 public class RadioButton : SelectButton
35 static RadioButton() { }
38 /// Creates a new instance of a RadioButton.
40 /// <since_tizen> 8 </since_tizen>
41 public RadioButton() : base() { }
43 /// Creates a new instance of a RadioButton with style.
45 /// <param name="style"></param>
46 /// <since_tizen> 8 </since_tizen>
47 public RadioButton(string style) : base(style) { }
49 /// Creates a new instance of a RadioButton with style.
51 /// <param name="buttonStyle"></param>
52 /// <since_tizen> 8 </since_tizen>
53 public RadioButton(ButtonStyle buttonStyle) : base(buttonStyle) { }
56 /// Get RadioButtonGroup to which this selections belong.
58 /// <since_tizen> 6 </since_tizen>
59 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
60 [EditorBrowsable(EditorBrowsableState.Never)]
61 public RadioButtonGroup ItemGroup
65 return base.ItemGroup as RadioButtonGroup;
69 base.ItemGroup = value;
74 [EditorBrowsable(EditorBrowsableState.Never)]
75 public override void ApplyStyle(ViewStyle viewStyle)
77 if (viewStyle is ButtonStyle buttonStyle)
79 if (buttonStyle.IsSelectable == null)
81 buttonStyle.IsSelectable = true;
84 base.ApplyStyle(buttonStyle);
89 /// Set CheckState to true after selecting RadioButton.
91 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
92 [EditorBrowsable(EditorBrowsableState.Never)]
93 protected override void OnSelectedChanged()
102 [EditorBrowsable(EditorBrowsableState.Never)]
103 protected override ImageView CreateIcon()
107 PositionUsesPivotPoint = true,
108 ParentOrigin = NUI.ParentOrigin.Center,
109 PivotPoint = NUI.PivotPoint.Center,
110 WidthResizePolicy = ResizePolicyType.DimensionDependency,
111 HeightResizePolicy = ResizePolicyType.SizeRelativeToParent,
112 SizeModeFactor = new Vector3(1, 1, 1),