Class Button

Definition

Namespace:
Tizen.NUI.UIComponents
Assembly:
Tizen.NUI.dll
API Level:
3

The Button class is a base class for different kinds of buttons.
This class provides the disabled property and the clicked signal.
The clicked event handler is emitted when the button is touched, and the touch point doesn't leave the boundary of the button.
When the disabled property is set to true, no signal is emitted.
The 'Visual' describes not just traditional images like PNG and BMP, but also refers to whatever is used to show the button. It could be a color, gradient, or some other kind of renderer.
The button's appearance can be modified by setting properties for the various visuals or images.
It is not mandatory to set all the visuals. A button could be defined only by setting its background visual, or by setting its background and selected visuals.
The button visual is shown over the background visual.
When pressed, the unselected visuals are replaced by the selected visuals.
The text label is always placed on the top of all images.
When the button is disabled, the background button and the selected visuals are replaced by their disabled visuals.

C#
Copy
public class Button : View, INotifyPropertyChanged, IDynamicResourceHandler, IElement, INameScope, IElementController, IDisposable, IResourcesProvider
Inheritance
Tizen.NUI.Binding.BindableObject
Tizen.NUI.Binding.Element
Button
Derived
Implements
System.IDisposable

Constructors

View Source

Button()

Creates an uninitialized button.
Only the derived versions can be instantiated.

Declaration
C#
Copy
public Button()
API Level: 3

Properties

View Source

AutoRepeating

If the autorepeating property is set to true, then the togglable property is set to false.

Declaration
C#
Copy
public bool AutoRepeating { get; set; }
Property Value
Type Description
Boolean
API Level: 3
View Source

DisabledSelectedBackgroundVisual

Gets or sets the disabled while selected background button visual.

Declaration
C#
Copy
public PropertyMap DisabledSelectedBackgroundVisual { get; set; }
Property Value
Type Description
PropertyMap
API Level: 3
View Source

DisabledSelectedVisual

Gets or sets the disabled selected state foreground or icon button visual.

Declaration
C#
Copy
public PropertyMap DisabledSelectedVisual { get; set; }
Property Value
Type Description
PropertyMap
API Level: 3
View Source

DisabledUnselectedBackgroundVisual

Gets or sets the disabled while unselected background button visual.

Declaration
C#
Copy
public PropertyMap DisabledUnselectedBackgroundVisual { get; set; }
Property Value
Type Description
PropertyMap
API Level: 3
View Source

DisabledUnselectedVisual

Gets or sets the disabled unselected state foreground or icon visual.

Declaration
C#
Copy
public PropertyMap DisabledUnselectedVisual { get; set; }
Property Value
Type Description
PropertyMap
API Level: 3
View Source

ForegroundVisualPadding

Gets or sets the padding around the foreground visual.

Declaration
C#
Copy
public Vector4 ForegroundVisualPadding { get; set; }
Property Value
Type Description
Vector4
API Level: 3
View Source

InitialAutoRepeatingDelay

By default, this value is set to 0.15 seconds.

Declaration
C#
Copy
public float InitialAutoRepeatingDelay { get; set; }
Property Value
Type Description
Single
API Level: 3
View Source

Label

Gets or sets the label.

Declaration
C#
Copy
public PropertyMap Label { get; set; }
Property Value
Type Description
PropertyMap
API Level: 3
View Source

LabelPadding

Gets or sets the padding around the text.

Declaration
C#
Copy
public Vector4 LabelPadding { get; set; }
Property Value
Type Description
Vector4
API Level: 3
View Source

LabelRelativeAlignment

Gets or sets the position of the the label in relation to the foreground or icon, if both present.

Declaration
C#
Copy
public Button.Align LabelRelativeAlignment { get; set; }
Property Value
Type Description
Button.Align
API Level: 3
View Source

LabelText

Gets or sets the text of the label.

Declaration
C#
Copy
public string LabelText { get; set; }
Property Value
Type Description
System.String
API Level: 3
View Source

NextAutoRepeatingDelay

By default, this value is set to 0.05 seconds.

Declaration
C#
Copy
public float NextAutoRepeatingDelay { get; set; }
Property Value
Type Description
Single
API Level: 3
View Source

Selected

Gets or sets the togglable button as either selected or unselected, togglable property must be set to true.

Declaration
C#
Copy
public bool Selected { get; set; }
Property Value
Type Description
Boolean
API Level: 3
View Source

SelectedBackgroundVisual

Gets or sets the selected background button visual.

Declaration
C#
Copy
public PropertyMap SelectedBackgroundVisual { get; set; }
Property Value
Type Description
PropertyMap
API Level: 3
View Source

SelectedColor

Gets or sets the selected color.

Declaration
C#
Copy
public Color SelectedColor { get; set; }
Property Value
Type Description
Color
API Level: 3
View Source

SelectedVisual

Gets or sets the selected button foreground or icon visual.

Declaration
C#
Copy
public PropertyMap SelectedVisual { get; set; }
Property Value
Type Description
PropertyMap
API Level: 3
View Source

Togglable

If the togglable property is set to true, then the autorepeating property is set to false.

Declaration
C#
Copy
public bool Togglable { get; set; }
Property Value
Type Description
Boolean
API Level: 3
View Source

UnselectedBackgroundVisual

Gets or sets the disabled unselected state background button visual.

Declaration
C#
Copy
public PropertyMap UnselectedBackgroundVisual { get; set; }
Property Value
Type Description
PropertyMap
API Level: 3
View Source

UnselectedColor

Gets or sets the unselected color.

Declaration
C#
Copy
public Color UnselectedColor { get; set; }
Property Value
Type Description
Color
API Level: 3
View Source

UnselectedVisual

Gets or sets the unselected button foreground or icon visual.

Declaration
C#
Copy
public PropertyMap UnselectedVisual { get; set; }
Property Value
Type Description
PropertyMap
API Level: 3

Methods

View Source

Dispose(DisposeTypes)

To dispose the button instance.

Declaration
C#
Copy
protected override void Dispose(DisposeTypes type)
Parameters
Type Name Description
DisposeTypes type
Overrides
API Level: 3

Events

View Source

Clicked

The Clicked event will be triggered when the button is touched and the touch point doesn't leave the boundary of the button.

Declaration
C#
Copy
public event EventHandlerWithReturnType<object, EventArgs, bool> Clicked
Event Type
Type Description
EventHandlerWithReturnType<Object, EventArgs, Boolean>
API Level: 3
View Source

Pressed

The Pressed event will be triggered when the button is touched.

Declaration
C#
Copy
public event EventHandlerWithReturnType<object, EventArgs, bool> Pressed
Event Type
Type Description
EventHandlerWithReturnType<Object, EventArgs, Boolean>
API Level: 3
View Source

Released

The Released event will be triggered when the button is touched and the touch point leaves the boundary of the button.

Declaration
C#
Copy
public event EventHandlerWithReturnType<object, EventArgs, bool> Released
Event Type
Type Description
EventHandlerWithReturnType<Object, EventArgs, Boolean>
API Level: 3
View Source

StateChanged

The StateChanged event will be triggered when the button's state is changed.

Declaration
C#
Copy
public event EventHandlerWithReturnType<object, EventArgs, bool> StateChanged
Event Type
Type Description
EventHandlerWithReturnType<Object, EventArgs, Boolean>
API Level: 3

Implements

System.IDisposable