Class Button
Definition
- Namespace:
- Tizen.NUI.UIComponents
- Assembly:
- Tizen.NUI.dll
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.
public class Button : View, INotifyPropertyChanged, IDisposable
- Inheritance
-
objectTizen.NUI.Binding.BindableObjectTizen.NUI.Binding.ElementButton
- Derived
- Implements
-
System.ComponentModel.INotifyPropertyChangedSystem.IDisposable
Constructors
View SourceButton()
Creates an uninitialized button.
Only the derived versions can be instantiated.
Declaration
public Button()
Properties
View SourceAutoRepeating
If the autorepeating property is set to true, then the togglable property is set to false.
Declaration
public bool AutoRepeating { get; set; }
Property Value
Type | Description |
---|---|
bool |
DisabledSelectedBackgroundVisual
Gets or sets the disabled while selected background button visual.
Declaration
public PropertyMap DisabledSelectedBackgroundVisual { get; set; }
Property Value
Type | Description |
---|---|
PropertyMap |
DisabledSelectedVisual
Gets or sets the disabled selected state foreground or icon button visual.
Declaration
public PropertyMap DisabledSelectedVisual { get; set; }
Property Value
Type | Description |
---|---|
PropertyMap |
DisabledUnselectedBackgroundVisual
Gets or sets the disabled while unselected background button visual.
Declaration
public PropertyMap DisabledUnselectedBackgroundVisual { get; set; }
Property Value
Type | Description |
---|---|
PropertyMap |
DisabledUnselectedVisual
Gets or sets the disabled unselected state foreground or icon visual.
Declaration
public PropertyMap DisabledUnselectedVisual { get; set; }
Property Value
Type | Description |
---|---|
PropertyMap |
ForegroundVisualPadding
Gets or sets the padding around the foreground visual.
Declaration
public Vector4 ForegroundVisualPadding { get; set; }
Property Value
Type | Description |
---|---|
Vector4 |
InitialAutoRepeatingDelay
By default, this value is set to 0.15 seconds.
Declaration
public float InitialAutoRepeatingDelay { get; set; }
Property Value
Type | Description |
---|---|
float |
Label
Gets or sets the label.
Declaration
public PropertyMap Label { get; set; }
Property Value
Type | Description |
---|---|
PropertyMap |
LabelPadding
Gets or sets the padding around the text.
Declaration
public Vector4 LabelPadding { get; set; }
Property Value
Type | Description |
---|---|
Vector4 |
LabelRelativeAlignment
Gets or sets the position of the the label in relation to the foreground or icon, if both present.
Declaration
public Button.Align LabelRelativeAlignment { get; set; }
Property Value
Type | Description |
---|---|
Button.Align |
LabelText
Gets or sets the text of the label.
Declaration
public string LabelText { get; set; }
Property Value
Type | Description |
---|---|
string |
NextAutoRepeatingDelay
By default, this value is set to 0.05 seconds.
Declaration
public float NextAutoRepeatingDelay { get; set; }
Property Value
Type | Description |
---|---|
float |
Selected
Gets or sets the togglable button as either selected or unselected, togglable property must be set to true.
Declaration
public bool Selected { get; set; }
Property Value
Type | Description |
---|---|
bool |
SelectedBackgroundVisual
Gets or sets the selected background button visual.
Declaration
public PropertyMap SelectedBackgroundVisual { get; set; }
Property Value
Type | Description |
---|---|
PropertyMap |
SelectedColor
Gets or sets the selected color.
Declaration
public Color SelectedColor { get; set; }
Property Value
Type | Description |
---|---|
Color |
SelectedVisual
Gets or sets the selected button foreground or icon visual.
Declaration
public PropertyMap SelectedVisual { get; set; }
Property Value
Type | Description |
---|---|
PropertyMap |
Togglable
If the togglable property is set to true, then the autorepeating property is set to false.
Declaration
public bool Togglable { get; set; }
Property Value
Type | Description |
---|---|
bool |
UnselectedBackgroundVisual
Gets or sets the disabled unselected state background button visual.
Declaration
public PropertyMap UnselectedBackgroundVisual { get; set; }
Property Value
Type | Description |
---|---|
PropertyMap |
UnselectedColor
Gets or sets the unselected color.
Declaration
public Color UnselectedColor { get; set; }
Property Value
Type | Description |
---|---|
Color |
UnselectedVisual
Gets or sets the unselected button foreground or icon visual.
Declaration
public PropertyMap UnselectedVisual { get; set; }
Property Value
Type | Description |
---|---|
PropertyMap |
Methods
View SourceDispose(DisposeTypes)
To dispose the button instance.
Declaration
protected override void Dispose(DisposeTypes type)
Parameters
Type | Name | Description |
---|---|---|
DisposeTypes | type |
Overrides
Events
View SourceClicked
The Clicked event will be triggered when the button is touched and the touch point doesn't leave the boundary of the button.
Declaration
public event EventHandlerWithReturnType<object, EventArgs, bool> Clicked
Event Type
Type | Description |
---|---|
EventHandlerWithReturnType<object, System.EventArgs, bool> |
Pressed
The Pressed event will be triggered when the button is touched.
Declaration
public event EventHandlerWithReturnType<object, EventArgs, bool> Pressed
Event Type
Type | Description |
---|---|
EventHandlerWithReturnType<object, System.EventArgs, bool> |
Released
The Released event will be triggered when the button is touched and the touch point leaves the boundary of the button.
Declaration
public event EventHandlerWithReturnType<object, EventArgs, bool> Released
Event Type
Type | Description |
---|---|
EventHandlerWithReturnType<object, System.EventArgs, bool> |
StateChanged
The StateChanged event will be triggered when the button's state is changed.
Declaration
public event EventHandlerWithReturnType<object, EventArgs, bool> StateChanged
Event Type
Type | Description |
---|---|
EventHandlerWithReturnType<object, System.EventArgs, bool> |