Class Button
Definition
- Namespace:
- Tizen.NUI.Components
- Assembly:
- Tizen.NUI.Components.dll
- API Level:
- 6
Button is one kind of common component, a button clearly describes what action will occur when the user selects it. Button may contain text or an icon.
public class Button : Control, INotifyPropertyChanged, IDynamicResourceHandler, IElement, INameScope, IElementController, IDisposable, IResourcesProvider
- Inheritance
-
Tizen.NUI.Binding.BindableObjectTizen.NUI.Binding.ElementTizen.NUI.Components.ControlButton
- Derived
- Implements
Constructors
View SourceButton()
Creates a new instance of a Button.
Declaration
public Button()
API Level: 6
View SourceButton(String)
Creates a new instance of a Button with style.
Declaration
public Button(string style)
Parameters
Type | Name | Description |
---|---|---|
String | style | Create Button by special style defined in UX. |
API Level: 8
View SourceButton(ButtonStyle)
Creates a new instance of a Button with style.
Declaration
public Button(ButtonStyle buttonStyle)
Parameters
Type | Name | Description |
---|---|---|
ButtonStyle | buttonStyle | Create Button by style customized by user. |
API Level: 8
Properties
View SourceFontFamily
Text font family in Button.
Declaration
public string FontFamily { get; set; }
Property Value
Type | Description |
---|---|
String |
API Level: 6
View SourceIcon
Button's icon part.
Declaration
public ImageView Icon { get; }
Property Value
Type | Description |
---|---|
ImageView |
API Level: 8
View SourceIconPadding
Icon padding in Button, work only when show icon and text.
Declaration
public Extents IconPadding { get; set; }
Property Value
Type | Description |
---|---|
Extents |
API Level: 6
View SourceIconRelativeOrientation
Icon relative orientation in Button, work only when show icon and text.
Declaration
public Button.IconOrientation? IconRelativeOrientation { get; set; }
Property Value
Type | Description |
---|---|
Nullable<Button.IconOrientation> |
API Level: 8
View SourceIconURL
Icon image's resource url in Button.
Declaration
public string IconURL { get; set; }
Property Value
Type | Description |
---|---|
String |
API Level: 6
View SourceIconURLSelector
Icon image's resource url selector in Button. Getter returns copied selector value if exist, null otherwise.
Declaration
public StringSelector IconURLSelector { get; set; }
Property Value
Type | Description |
---|---|
Tizen.NUI.Components.StringSelector |
Exceptions
Type | Condition |
---|---|
NullReferenceException | Thrown when setting null value. |
API Level: 6
View SourceIsEnabled
Flag to decide enable or disable in Button.
Declaration
public bool IsEnabled { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
API Level: 6
View SourceIsSelectable
Flag to decide Button can be selected or not.
Declaration
public bool IsSelectable { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
API Level: 6
View SourceIsSelected
Flag to decide selected state in Button.
Declaration
public bool IsSelected { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
API Level: 6
View SourceOverlayImage
Button's overlay image part.
Declaration
public ImageView OverlayImage { get; }
Property Value
Type | Description |
---|---|
ImageView |
API Level: 8
View SourcePointSize
Text point size in Button.
Declaration
public float PointSize { get; set; }
Property Value
Type | Description |
---|---|
Single |
API Level: 6
View SourcePointSizeSelector
Text font size selector in Button. Getter returns copied selector value if exist, null otherwise.
Declaration
public FloatSelector PointSizeSelector { get; set; }
Property Value
Type | Description |
---|---|
Tizen.NUI.Components.FloatSelector |
Exceptions
Type | Condition |
---|---|
NullReferenceException | Thrown when setting null value. |
API Level: 6
View SourceStyle
Return a copied Style instance of Button
Declaration
public ButtonStyle Style { get; }
Property Value
Type | Description |
---|---|
ButtonStyle |
Remarks
It returns copied Style instance and changing it does not effect to the Button. Style setting is possible by using constructor or the function of ApplyStyle(ViewStyle viewStyle)
API Level: 8
View SourceText
The text of Button.
Declaration
public string Text { get; set; }
Property Value
Type | Description |
---|---|
String |
API Level: 6
View SourceTextAlignment
Text horizontal alignment in Button.
Declaration
public HorizontalAlignment TextAlignment { get; set; }
Property Value
Type | Description |
---|---|
HorizontalAlignment |
API Level: 6
View SourceTextColor
Text color in Button.
Declaration
public Color TextColor { get; set; }
Property Value
Type | Description |
---|---|
Color |
API Level: 6
View SourceTextColorSelector
Text color selector in Button. Getter returns copied selector value if exist, null otherwise.
Declaration
public ColorSelector TextColorSelector { get; set; }
Property Value
Type | Description |
---|---|
Tizen.NUI.Components.ColorSelector |
Exceptions
Type | Condition |
---|---|
NullReferenceException | Thrown when setting null value. |
API Level: 6
View SourceTextLabel
Button's text part.
Declaration
public TextLabel TextLabel { get; }
Property Value
Type | Description |
---|---|
TextLabel |
API Level: 8
View SourceTextPadding
Text padding in Button, work only when show icon and text.
Declaration
public Extents TextPadding { get; set; }
Property Value
Type | Description |
---|---|
Extents |
API Level: 6
View SourceTextSelector
Text string selector in Button. Getter returns copied selector value if exist, null otherwise. NullReferenceException
Declaration
public StringSelector TextSelector { get; set; }
Property Value
Type | Description |
---|---|
Tizen.NUI.Components.StringSelector |
API Level: 6
View SourceTranslatableText
Translate text string in Button.
Declaration
public string TranslatableText { get; set; }
Property Value
Type | Description |
---|---|
String |
API Level: 6
View SourceTranslatableTextSelector
Translateable text string selector in Button. Getter returns copied selector value if exist, null otherwise.
Declaration
public StringSelector TranslatableTextSelector { get; set; }
Property Value
Type | Description |
---|---|
Tizen.NUI.Components.StringSelector |
Exceptions
Type | Condition |
---|---|
NullReferenceException | Thrown when setting null value. |
API Level: 6
Methods
View SourceApplyStyle(ViewStyle)
Apply style to button.
Declaration
public override void ApplyStyle(ViewStyle viewStyle)
Parameters
Type | Name | Description |
---|---|---|
Tizen.NUI.BaseComponents.ViewStyle | viewStyle | The style to apply. |
Overrides
API Level: 6
View SourceCreateViewStyle()
Get Button style.
Declaration
protected override ViewStyle CreateViewStyle()
Returns
Type | Description |
---|---|
Tizen.NUI.BaseComponents.ViewStyle | The default button style. |
Overrides
API Level: 8
View SourceDispose(DisposeTypes)
Dispose Button and all children on it.
Declaration
protected override void Dispose(DisposeTypes type)
Parameters
Type | Name | Description |
---|---|---|
DisposeTypes | type | Dispose type. |
Overrides
API Level: 6
View SourceOnFocusGained()
Called when the control gain key input focus. Should be overridden by derived classes if they need to customize what happens when the focus is gained.
Declaration
public override void OnFocusGained()
Overrides
API Level: 8
View SourceOnFocusLost()
Called when the control loses key input focus. Should be overridden by derived classes if they need to customize what happens when the focus is lost.
Declaration
public override void OnFocusLost()
Overrides
API Level: 8
View SourceOnKey(Key)
Called after a key event is received by the view that has had its focus set.
Declaration
public override bool OnKey(Key key)
Parameters
Type | Name | Description |
---|---|---|
Key | key | The key event. |
Returns
Type | Description |
---|---|
Boolean | True if the key event should be consumed. |
Overrides
API Level: 6
View SourceOnTouch(Touch)
Called after a touch event is received by the owning view.
CustomViewBehaviour.REQUIRES_TOUCH_EVENTS must be enabled during construction. See CustomView(ViewWrapperImpl.CustomViewBehaviour behaviour).
Declaration
[Obsolete("Deprecated in API8; Will be removed in API10. Please use OnClicked instead.")]
public override bool OnTouch(Touch touch)
Parameters
Type | Name | Description |
---|---|---|
Touch | touch | The touch event. |
Returns
Type | Description |
---|---|
Boolean | True if the event should be consumed. |
Overrides
API Level: 8
Events
View SourceClicked
An event for the button clicked signal which can be used to subscribe or unsubscribe the event handler provided by the user.
Declaration
public event EventHandler<ClickedEventArgs> Clicked
Event Type
Type | Description |
---|---|
EventHandler<ClickedEventArgs> |
API Level: 8
View SourceClickEvent
An event for the button clicked signal which can be used to subscribe or unsubscribe the event handler provided by the user.
Declaration
[Obsolete("Deprecated in API8; Will be removed in API10. Please use Clicked event instead.")]
public event EventHandler<Button.ClickEventArgs> ClickEvent
Event Type
Type | Description |
---|---|
EventHandler<Button.ClickEventArgs> |
API Level: 6
View SourceStateChangedEvent
An event for the button state changed signal which can be used to subscribe or unsubscribe the event handler provided by the user.
Declaration
[Obsolete("Deprecated in API8; Will be removed in API10. Please use View.ControlStateChangedEvent")]
public event EventHandler<Button.StateChangedEventArgs> StateChangedEvent
Event Type
Type | Description |
---|---|
EventHandler<Button.StateChangedEventArgs> |