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, IDynamicResourceHandler, IElement, INameScope, IElementController, System.IDisposable, IResourcesProvider
- Inheritance
-
- Derived
-
- Implements
-
Constructors
Declaration
API Level: 6
View Source
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 Source
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
Fields
Declaration
public static readonly BindableProperty FontFamilyProperty
Field Value
Declaration
public static readonly BindableProperty IconPaddingProperty
Field Value
Declaration
public static readonly BindableProperty IconRelativeOrientationProperty
Field Value
Declaration
public static readonly BindableProperty IconSizeProperty
Field Value
Declaration
public static readonly BindableProperty IconURLProperty
Field Value
Declaration
public static readonly BindableProperty IconURLSelectorProperty
Field Value
Declaration
public static readonly BindableProperty IsSelectableProperty
Field Value
Declaration
public static readonly BindableProperty IsSelectedProperty
Field Value
Declaration
public static readonly BindableProperty PointSizeProperty
Field Value
Declaration
public static readonly BindableProperty PointSizeSelectorProperty
Field Value
Declaration
public static readonly BindableProperty TextAlignmentProperty
Field Value
Declaration
public static readonly BindableProperty TextColorProperty
Field Value
View Source
TextColorSelectorProperty
TextColorSelectorProperty
Declaration
public static readonly BindableProperty TextColorSelectorProperty
Field Value
Declaration
public static readonly BindableProperty TextPaddingProperty
Field Value
Declaration
public static readonly BindableProperty TextProperty
Field Value
Declaration
public static readonly BindableProperty TextSelectorProperty
Field Value
Declaration
public static readonly BindableProperty TranslatableTextProperty
Field Value
View Source
TranslatableTextSelectorProperty
TranslatableTextSelectorProperty
Declaration
public static readonly BindableProperty TranslatableTextSelectorProperty
Field Value
Properties
View Source
The ButtonExtension instance that is injected by ButtonStyle.
Declaration
protected ButtonExtension Extension { get; set; }
Property Value
Declaration
public string FontFamily { get; set; }
Property Value
API Level: 6
Declaration
public ImageView Icon { get; }
Property Value
API Level: 8
View Source
Icon padding in Button. It is shortcut of Icon.Padding.
Declaration
public Extents IconPadding { get; set; }
Property Value
API Level: 6
View Source
Icon relative orientation in Button, work only when show icon and text.
Declaration
public Button.IconOrientation? IconRelativeOrientation { get; set; }
Property Value
API Level: 8
Declaration
public Size IconSize { get; set; }
Property Value
Declaration
public string IconURL { get; set; }
Property Value
API Level: 6
View Source
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
API Level: 6
View Source
Flag to decide enable or disable in Button.
Declaration
public bool IsEnabled { get; set; }
Property Value
API Level: 6
View Source
Flag to decide Button can be selected or not.
Declaration
public bool IsSelectable { get; set; }
Property Value
API Level: 6
Declaration
public bool IsSelected { get; set; }
Property Value
API Level: 6
Declaration
public LinearLayout.Alignment ItemAlignment { get; set; }
Property Value
API Level: 9
View Source
The item (text or icon or both) horizontal alignment.
Declaration
public HorizontalAlignment ItemHorizontalAlignment { get; set; }
Property Value
View Source
The space between icon and text.
The value is applied when there exist icon and text both.
The width value is used when the items are arranged horizontally. Otherwise, the height value is used.
Declaration
public Size2D ItemSpacing { get; set; }
Property Value
API Level: 9
View Source
The item (text or icon or both) vertical alignment.
Declaration
public VerticalAlignment ItemVerticalAlignment { get; set; }
Property Value
Declaration
public ImageView OverlayImage { get; }
Property Value
API Level: 8
Declaration
public float PointSize { get; set; }
Property Value
API Level: 6
View Source
Text font size selector in Button.
Getter returns copied selector value if exist, null otherwise.
Declaration
public FloatSelector PointSizeSelector { get; set; }
Property Value
API Level: 6
Declaration
public ButtonStyle Style { get; }
Property Value
API Level: 8
Declaration
public string Text { get; set; }
Property Value
API Level: 6
View Source
TextAlignment
Text horizontal alignment in Button.
Declaration
public HorizontalAlignment TextAlignment { get; set; }
Property Value
API Level: 6
Declaration
public Color TextColor { get; set; }
Property Value
API Level: 6
View Source
TextColorSelector
Text color selector in Button.
Getter returns copied selector value if exist, null otherwise.
Declaration
public ColorSelector TextColorSelector { get; set; }
Property Value
API Level: 6
Declaration
public TextLabel TextLabel { get; }
Property Value
API Level: 8
View Source
TextPadding
Text padding in Button. It is shortcut of TextLabel.Padding.
Declaration
public Extents TextPadding { get; set; }
Property Value
API Level: 6
View Source
TextSelector
Text string selector in Button.
Getter returns copied selector value if exist, null otherwise.
Thrown when setting null value.
Declaration
public StringSelector TextSelector { get; set; }
Property Value
API Level: 6
View Source
TranslatableText
Translate text string in Button.
Declaration
public string TranslatableText { get; set; }
Property Value
API Level: 6
View Source
TranslatableTextSelector
Translatable text string selector in Button.
Getter returns copied selector value if exist, null otherwise.
Declaration
public StringSelector TranslatableTextSelector { get; set; }
Property Value
API Level: 6
Methods
Declaration
protected override AccessibilityStates AccessibilityCalculateStates()
Returns
Overrides
Declaration
protected override string AccessibilityGetName()
Returns
Overrides
Declaration
public override void ApplyStyle(ViewStyle viewStyle)
Parameters
Type |
Name |
Description |
ViewStyle |
viewStyle |
The style to apply.
|
Overrides
API Level: 8
Declaration
protected virtual ImageView CreateIcon()
Returns
Declaration
protected virtual ImageView CreateOverlayImage()
Returns
Declaration
protected virtual TextLabel CreateText()
Returns
Declaration
protected override ViewStyle CreateViewStyle()
Returns
Type |
Description |
ViewStyle |
The default button style.
|
Overrides
API Level: 8
Declaration
protected override void Dispose(DisposeTypes type)
Parameters
Overrides
API Level: 6
View Source
The touch event handler for ControlState.
Please change ControlState value by touch state if needed.
Declaration
protected override bool HandleControlStateOnTouch(Touch touch)
Parameters
Type |
Name |
Description |
Touch |
touch |
|
Returns
Overrides
View Source
Put sub items (e.g. buttonText, buttonIcon) to the right place.
Declaration
protected virtual void LayoutItems()
View Source
Called when the Button is Clicked by a user
Declaration
protected virtual void OnClicked(ClickedEventArgs eventArgs)
Parameters
View Source
Called after the View's ControlStates changed.
Declaration
protected override void OnControlStateChanged(View.ControlStateChangedEventArgs controlStateChangedInfo)
Parameters
Overrides
View Source
Internal callback of enabled property changes.
Inherited view can override this method to implements enabled property changes.
Declaration
protected override void OnEnabled(bool enabled)
Parameters
Type |
Name |
Description |
Boolean |
enabled |
|
Overrides
View Source
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 Source
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
Declaration
public override void OnInitialize()
Overrides
View Source
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 Source
Called after the size negotiation has been finished for this control.
The control is expected to assign this given size to itself or its children.
Should be overridden by derived classes if they need to layout views differently after certain operations like add or remove views, resize, or after changing specific properties.
As this function is called from inside the size negotiation algorithm, you cannot call RequestRelayout (the call would just be ignored).
Declaration
public override void OnRelayout(Vector2 size, RelayoutContainer container)
Parameters
Type |
Name |
Description |
Vector2 |
size |
The allocated size.
|
RelayoutContainer |
container |
The control should add views to this container that it is not able to allocate a size for.
|
Overrides
View Source
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
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
Declaration
protected override void OnUpdate()
Overrides
Declaration
protected void UpdateState()
API Level: 6
Events
View Source
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
API Level: 8
View Source
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<Button.ClickEventArgs> ClickEvent
Event Type
API Level: 6
View Source
An event for the button state changed signal which can be used to subscribe or unsubscribe the event handler provided by the user.
Declaration
public event EventHandler<Button.StateChangedEventArgs> StateChangedEvent
Event Type
API Level: 6
Implements
Extension Methods