Class Switch

Definition

Namespace:
Tizen.NUI.Components
Assembly:
Tizen.NUI.Components.dll
API Level:
6

Switch is a kind of Button component that uses icon part as a toggle shape. The icon part consists of track and thumb.

C#
Copy
public class Switch : Button, IDynamicResourceHandler, IElement, INameScope, IElementController, System.IDisposable, IResourcesProvider
Inheritance
Implements

Constructors

View Source

Switch()

Creates a new instance of a Switch.

Declaration
C#
Copy
public Switch()
API Level: 6
View Source

Switch(String)

Creates a new instance of a Switch with style.

Declaration
C#
Copy
public Switch(string style)
Parameters
Type Name Description
String style

Create Switch by special style defined in UX.

API Level: 8
View Source

Switch(SwitchStyle)

Creates a new instance of a Switch with style.

Declaration
C#
Copy
public Switch(SwitchStyle switchStyle)
Parameters
Type Name Description
SwitchStyle switchStyle

Create Switch by style customized by user.

API Level: 8

Fields

View Source

SwitchBackgroundImageURLSelectorProperty

SwitchBackgroundImageURLSelectorProperty

Declaration
C#
Copy
public static readonly BindableProperty SwitchBackgroundImageURLSelectorProperty
Field Value
Type Description
BindableProperty
View Source

SwitchHandlerImageSizeProperty

SwitchHandlerImageSizeProperty

Declaration
C#
Copy
public static readonly BindableProperty SwitchHandlerImageSizeProperty
Field Value
Type Description
BindableProperty
View Source

SwitchHandlerImageURLProperty

SwitchHandlerImageURLProperty

Declaration
C#
Copy
public static readonly BindableProperty SwitchHandlerImageURLProperty
Field Value
Type Description
BindableProperty
View Source

SwitchHandlerImageURLSelectorProperty

SwitchHandlerImageURLSelectorProperty

Declaration
C#
Copy
public static readonly BindableProperty SwitchHandlerImageURLSelectorProperty
Field Value
Type Description
BindableProperty

Properties

View Source

Style

Return currently applied style.

Declaration
C#
Copy
public SwitchStyle Style { get; }
Property Value
Type Description
SwitchStyle
Remarks

Modifying contents in style may cause unexpected behaviour.

API Level: 8
View Source

SwitchBackgroundImageURLSelector

Switch's track part image url selector.

Declaration
C#
Copy
public StringSelector SwitchBackgroundImageURLSelector { get; set; }
Property Value
Type Description
StringSelector
API Level: 6
View Source

SwitchHandlerImageSize

Handler image's size in Switch.

Declaration
C#
Copy
public Size SwitchHandlerImageSize { get; set; }
Property Value
Type Description
Size
API Level: 6
View Source

SwitchHandlerImageURL

Handler image's resource url in Switch.

Declaration
C#
Copy
public string SwitchHandlerImageURL { get; set; }
Property Value
Type Description
String
API Level: 6
View Source

SwitchHandlerImageURLSelector

Handler image's resource url selector in Switch. Getter returns copied selector value if exist, null otherwise.

Declaration
C#
Copy
public StringSelector SwitchHandlerImageURLSelector { get; set; }
Property Value
Type Description
StringSelector
API Level: 6
View Source

Thumb

Switch's thumb part.

Declaration
C#
Copy
public ImageView Thumb { get; }
Property Value
Type Description
ImageView
API Level: 8
View Source

Track

Switch's track part.

Declaration
C#
Copy
public ImageView Track { get; }
Property Value
Type Description
ImageView
API Level: 8

Methods

View Source

AccessibilityCalculateStates()

Informs AT-SPI bridge about the set of AT-SPI states associated with this object.

Declaration
C#
Copy
protected override AccessibilityStates AccessibilityCalculateStates()
Returns
Type Description
AccessibilityStates
Overrides
View Source

ApplyStyle(ViewStyle)

Apply style to switch.

Declaration
C#
Copy
public override void ApplyStyle(ViewStyle viewStyle)
Parameters
Type Name Description
ViewStyle viewStyle

The style to apply.

Overrides
View Source

CreateIcon()

Creates Button's icon part.

Declaration
C#
Copy
protected override ImageView CreateIcon()
Returns
Type Description
ImageView
Overrides
View Source

CreateViewStyle()

Get Switch style.

Declaration
C#
Copy
protected override ViewStyle CreateViewStyle()
Returns
Type Description
ViewStyle

The default switch style.

Overrides
API Level: 8
View Source

Dispose(DisposeTypes)

Dispose Switch and all children on it.

Declaration
C#
Copy
protected override void Dispose(DisposeTypes type)
Parameters
Type Name Description
DisposeTypes type

Dispose type.

Overrides
API Level: 6
View Source

OnControlStateChanged(View.ControlStateChangedEventArgs)

Called after the View's ControlStates changed.

Declaration
C#
Copy
protected override void OnControlStateChanged(View.ControlStateChangedEventArgs controlStateChangedInfo)
Parameters
Type Name Description
View.ControlStateChangedEventArgs controlStateChangedInfo

The information including state changed variables.

Overrides
View Source

OnInitialize()

Initialize AT-SPI object.

Declaration
C#
Copy
public override void OnInitialize()
Overrides
View Source

OnKey(Key)

Called after a key event is received by the view that has had its focus set.

Declaration
C#
Copy
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: 8
View Source

OnTouch(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
C#
Copy
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 Source

SelectedChanged

An event for the item selected signal which can be used to subscribe or unsubscribe the event handler provided by the user.

Declaration
C#
Copy
public event EventHandler<SelectedChangedEventArgs> SelectedChanged
Event Type
Type Description
EventHandler<SelectedChangedEventArgs>
API Level: 8
View Source

SelectedEvent

An event for the item selected signal which can be used to subscribe or unsubscribe the event handler provided by the user.

Declaration
C#
Copy
public event EventHandler<Switch.SelectEventArgs> SelectedEvent
Event Type
Type Description
EventHandler<Switch.SelectEventArgs>
API Level: 6

Implements

Extension Methods