Class Switch

    Definition

    Namespace:
    Tizen.NUI.Components
    Assembly:
    Tizen.NUI.Components.dll

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

    public class Switch : Button, IDynamicResourceHandler, INameScope, System.IDisposable, IResourcesProvider
    Inheritance
    object
    BindableObject
    Element
    BaseHandle
    Animatable
    Container
    View
    ViewWrapper
    CustomView
    VisualView
    Control
    Button
    Switch
    Implements
    IDynamicResourceHandler
    INameScope
    System.IDisposable
    IResourcesProvider

    Constructors

    View Source

    Switch()

    Creates a new instance of a Switch.

    Declaration
    public Switch()
    View Source

    Switch(string)

    Creates a new instance of a Switch with style.

    Declaration
    public Switch(string style)
    Parameters
    Type Name Description
    string style

    Create Switch by special style defined in UX.

    View Source

    Switch(SwitchStyle)

    Creates a new instance of a Switch with style.

    Declaration
    public Switch(SwitchStyle switchStyle)
    Parameters
    Type Name Description
    SwitchStyle switchStyle

    Create Switch by style customized by user.

    Fields

    View Source

    SwitchBackgroundImageURLSelectorProperty

    SwitchBackgroundImageURLSelectorProperty

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

    SwitchHandlerImageSizeProperty

    SwitchHandlerImageSizeProperty

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

    SwitchHandlerImageURLProperty

    SwitchHandlerImageURLProperty

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

    SwitchHandlerImageURLSelectorProperty

    SwitchHandlerImageURLSelectorProperty

    Declaration
    public static readonly BindableProperty SwitchHandlerImageURLSelectorProperty
    Field Value
    Type Description
    BindableProperty

    Properties

    View Source

    Style

    Return currently applied style.

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

    Modifying contents in style may cause unexpected behaviour.

    View Source

    SwitchBackgroundImageURLSelector

    Switch's track part image url selector.

    Declaration
    public StringSelector SwitchBackgroundImageURLSelector { get; set; }
    Property Value
    Type Description
    StringSelector
    View Source

    SwitchHandlerImageSize

    Handler image's size in Switch.

    Declaration
    public Size SwitchHandlerImageSize { get; set; }
    Property Value
    Type Description
    Size
    View Source

    SwitchHandlerImageURL

    Handler image's resource url in Switch.

    Declaration
    public string SwitchHandlerImageURL { get; set; }
    Property Value
    Type Description
    string
    View Source

    SwitchHandlerImageURLSelector

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

    Declaration
    public StringSelector SwitchHandlerImageURLSelector { get; set; }
    Property Value
    Type Description
    StringSelector
    View Source

    Thumb

    Switch's thumb part.

    Declaration
    public ImageView Thumb { get; }
    Property Value
    Type Description
    ImageView
    View Source

    Track

    Switch's track part.

    Declaration
    public ImageView Track { get; }
    Property Value
    Type Description
    ImageView

    Methods

    View Source

    AccessibilityCalculateStates()

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

    Declaration
    protected override AccessibilityStates AccessibilityCalculateStates()
    Returns
    Type Description
    AccessibilityStates
    Overrides
    Button.AccessibilityCalculateStates()
    View Source

    ApplyStyle(ViewStyle)

    Apply style to switch.

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

    The style to apply.

    Overrides
    Button.ApplyStyle(ViewStyle)
    View Source

    CreateIcon()

    Creates Button's icon part.

    Declaration
    protected override ImageView CreateIcon()
    Returns
    Type Description
    ImageView
    Overrides
    Button.CreateIcon()
    View Source

    CreateViewStyle()

    Get Switch style.

    Declaration
    protected override ViewStyle CreateViewStyle()
    Returns
    Type Description
    ViewStyle

    The default switch style.

    Overrides
    Button.CreateViewStyle()
    View Source

    Dispose(DisposeTypes)

    Dispose Switch and all children on it.

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

    Dispose type.

    Overrides
    Button.Dispose(DisposeTypes)
    View Source

    OnControlStateChanged(ControlStateChangedEventArgs)

    Called after the View's ControlStates changed.

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

    The information including state changed variables.

    Overrides
    Button.OnControlStateChanged(View.ControlStateChangedEventArgs)
    View Source

    OnInitialize()

    Initialize AT-SPI object.

    Declaration
    public override void OnInitialize()
    Overrides
    Button.OnInitialize()
    View Source

    OnKey(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
    bool

    True if the key event should be consumed.

    Overrides
    Button.OnKey(Key)
    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
    public override bool OnTouch(Touch touch)
    Parameters
    Type Name Description
    Touch touch

    The touch event.

    Returns
    Type Description
    bool

    True if the event should be consumed.

    Overrides
    Button.OnTouch(Touch)

    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
    public event EventHandler<SelectedChangedEventArgs> SelectedChanged
    Event Type
    Type Description
    EventHandler<><SelectedChangedEventArgs>
    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
    public event EventHandler<Switch.SelectEventArgs> SelectedEvent
    Event Type
    Type Description
    EventHandler<><SelectEventArgs>

    Implements

    IDynamicResourceHandler
    INameScope
    System.IDisposable
    IResourcesProvider

    Extension Methods

    ViewExtensions.BackgroundColor(View)
    ViewExtensions.BorderlineColor(View)
    ViewExtensions.BoxShadow(View)
    ViewExtensions.Color(View)
    ViewExtensions.CornerRadius(View)
    EXamlExtensions.LoadFromEXamlByRelativePath<T>(T, string)
    ViewExtensions.BackgroundColor<T>(T, float, float, float, float)
    ViewExtensions.BackgroundColor<T>(T, uint, float)
    ViewExtensions.BackgroundColor<T>(T, UIColor)
    ViewExtensions.BackgroundImage<T>(T, string)
    ViewExtensions.Borderline<T>(T, float, UIColor, float)
    ViewExtensions.BorderlineColor<T>(T, float, float, float, float)
    ViewExtensions.BorderlineColor<T>(T, uint, float)
    ViewExtensions.BorderlineColor<T>(T, UIColor)
    ViewExtensions.BorderlineOffset<T>(T, float)
    ViewExtensions.BorderlineWidth<T>(T, float)
    ViewExtensions.BoxShadow<T>(T, float, float, float)
    ViewExtensions.BoxShadow<T>(T, float, UIColor, float, float)
    ViewExtensions.BoxShadow<T>(T, UIShadow)
    ViewExtensions.ClippingMode<T>(T, ClippingModeType)
    ViewExtensions.Color<T>(T, float, float, float, float)
    ViewExtensions.Color<T>(T, uint, float)
    ViewExtensions.Color<T>(T, UIColor)
    ViewExtensions.CornerRadius<T>(T, float, bool)
    ViewExtensions.CornerRadius<T>(T, float, float, float, float, bool)
    ViewExtensions.CornerRadius<T>(T, UICorner)
    ViewExtensions.Focusable<T>(T, bool)
    ViewExtensions.FocusableChildren<T>(T, bool)
    ViewExtensions.FocusableInTouch<T>(T, bool)
    ViewExtensions.ImageShadow<T>(T, ImageShadow)
    ViewExtensions.IsEnabled<T>(T, bool)
    ViewExtensions.Layout<T>(T, LayoutItem)
    ViewExtensions.Opacity<T>(T, float)
    ViewExtensions.Position<T>(T, float, float)
    ViewExtensions.PositionX<T>(T, float)
    ViewExtensions.PositionY<T>(T, float)
    ViewExtensions.Scale<T>(T, float, float)
    ViewExtensions.ScaleX<T>(T, float)
    ViewExtensions.ScaleY<T>(T, float)
    ViewExtensions.Sensitive<T>(T, bool)
    ViewExtensions.Size<T>(T, float, float)
    ViewExtensions.SizeHeight<T>(T, float)
    ViewExtensions.SizeWidth<T>(T, float)
    ViewExtensions.Visibility<T>(T, bool)
    ViewExtensions.VoiceInteractionName<T>(T, string)
    Extensions.LoadFromXaml<TXaml>(TXaml, string)
    Extensions.LoadFromXaml<TXaml>(TXaml, Type)
    Extensions.LoadFromXamlFile<TXaml>(TXaml, string)
    • View Source
    Back to top Copyright © 2016-2025 Samsung
    Generated by DocFX