Class NUIGadget

    Definition

    Namespace:
    Tizen.NUI
    Assembly:
    Tizen.NUI.Gadget.dll

    Represents a NUIGadget controlled lifecycle.

    public abstract class NUIGadget : IUIGadget
    Inheritance
    object
    NUIGadget
    Implements
    IUIGadget
    Remarks

    This class provides functionality related to managing the lifecycle of a NUIGadget. It enables developers to handle events such as initialization, activation, deactivation, and destruction of the gadget. By implementing this class, developers can define their own behavior for these events and customize the lifecycle of their gadgets accordingly.

    Constructors

    View Source

    NUIGadget(NUIGadgetType, IServiceFactory, bool)

    Initializes the gadget with OneShotService factory.

    Declaration
    public NUIGadget(NUIGadgetType type, IServiceFactory serviceFactory, bool autoClose = true)
    Parameters
    Type Name Description
    NUIGadgetType type

    The type of the NUIGadget.

    IServiceFactory serviceFactory

    The factory that can create OneShotService object

    bool autoClose

    Whether to automatically close the service after execution

    Remarks

    This constructor initializes a new instance of the NUIGadget class based on the specified type with OneShotService. It is important to provide the correct type argument in order to ensure proper functionality and compatibility with other components.

    View Source

    NUIGadget(NUIGadgetType)

    Initializes the gadget.

    Declaration
    public NUIGadget(NUIGadgetType type)
    Parameters
    Type Name Description
    NUIGadgetType type

    The type of the NUIGadget.

    Remarks

    This constructor initializes a new instance of the NUIGadget class based on the specified type. It is important to provide the correct type argument in order to ensure proper functionality and compatibility with other components.

    Properties

    View Source

    ClassName

    The class name.

    Declaration
    public string ClassName { get; }
    Property Value
    Type Description
    string
    Remarks

    This property is set before the OnCreate() is called, after the instance has been created. It provides access to the name of the class that was used to create the current instance.

    View Source

    MainView

    The main view of the NUI gadget.

    Declaration
    public View MainView { get; }
    Property Value
    Type Description
    View
    Remarks

    This class provides functionality related to managing the lifecycle of a NUIGadget. It enables developers to handle events such as initialization, activation, deactivation, and destruction of the gadget. By implementing this class, developers can define their own behavior for these events and customize the lifecycle of their gadgets accordingly.

    View Source

    NUIGadgetInfo

    The class representing information of the current gadget.

    Declaration
    public NUIGadgetInfo NUIGadgetInfo { get; }
    Property Value
    Type Description
    NUIGadgetInfo
    Remarks

    This property is set before the OnCreate() is called, after the instance has been created. It provides details about the current gadget such as its ID, name, version, and other relevant information. By accessing this property, developers can retrieve the necessary information about the gadget they are working on.

    View Source

    NUIGadgetResourceManager

    The resource manager.

    Declaration
    public NUIGadgetResourceManager NUIGadgetResourceManager { get; }
    Property Value
    Type Description
    NUIGadgetResourceManager
    Remarks

    This property is set before the OnCreate() is called, after the instance has been created. It provides access to various resources such as images, sounds, and fonts that can be used in your application. By utilizing the resource manager, you can easily manage and retrieve these resources without having to manually handle their loading and unloading. Additionally, the resource manager ensures efficient memory management by automatically handling the caching and recycling of resources.

    View Source

    Service

    The OneShotService.

    Declaration
    public OneShotService Service { get; }
    Property Value
    Type Description
    OneShotService
    Remarks

    This class provides functionality related to managing the lifecycle of a NUIGadget. It enables developers to handle events such as initialization, activation, deactivation, and destruction of the gadget. By implementing this class, developers can define their own behavior for these events and customize the lifecycle of their gadgets accordingly.

    View Source

    State

    The current lifecycle state of the gadget.

    Declaration
    public NUIGadgetLifecycleState State { get; }
    Property Value
    Type Description
    NUIGadgetLifecycleState
    Remarks

    This class provides functionality related to managing the lifecycle of a NUIGadget. It enables developers to handle events such as initialization, activation, deactivation, and destruction of the gadget. By implementing this class, developers can define their own behavior for these events and customize the lifecycle of their gadgets accordingly.

    View Source

    Type

    The type of the NUI gadget.

    Declaration
    public NUIGadgetType Type { get; }
    Property Value
    Type Description
    NUIGadgetType
    Remarks

    This class provides functionality related to managing the lifecycle of a NUIGadget. It enables developers to handle events such as initialization, activation, deactivation, and destruction of the gadget. By implementing this class, developers can define their own behavior for these events and customize the lifecycle of their gadgets accordingly.

    Methods

    View Source

    Finish()

    Finishes the gadget.

    Declaration
    public void Finish()
    Remarks

    This class provides functionality related to managing the lifecycle of a NUIGadget. It enables developers to handle events such as initialization, activation, deactivation, and destruction of the gadget. By implementing this class, developers can define their own behavior for these events and customize the lifecycle of their gadgets accordingly.

    View Source

    OnAppControlReceived(AppControlReceivedEventArgs)

    Overrides this method if want to handle behavior when the gadget receives the appcontrol message.

    Declaration
    protected virtual void OnAppControlReceived(AppControlReceivedEventArgs e)
    Parameters
    Type Name Description
    AppControlReceivedEventArgs e

    The appcontrol received event argument containing details about the received message.

    Remarks

    This method provides a way to customize the response when the gadget receives an appcontrol message. By overriding this method in your derived class, you can define specific actions based on the incoming arguments.

    View Source

    OnCreate()

    Override this method to define the behavior when the gadget is created. Calling 'base.OnCreate()' is necessary in order to emit the 'NUIGadgetLifecycleChanged' event with the 'NUIGadgetLifecycleState.Created' state.

    Declaration
    protected virtual View OnCreate()
    Returns
    Type Description
    View

    The main view object.

    Remarks

    This class provides functionality related to managing the lifecycle of a NUIGadget. It enables developers to handle events such as initialization, activation, deactivation, and destruction of the gadget. By implementing this class, developers can define their own behavior for these events and customize the lifecycle of their gadgets accordingly.

    View Source

    OnDestroy()

    Override this method to handle the behavior when the gadget is destroyed. If 'base.OnDestroy()' is not called, the 'NUIGadgetLifecycleChanged' event with the 'NUIGadgetLifecycleState.Destroyed' state will not be emitted.

    Declaration
    protected virtual void OnDestroy()
    Remarks

    This class provides functionality related to managing the lifecycle of a NUIGadget. It enables developers to handle events such as initialization, activation, deactivation, and destruction of the gadget. By implementing this class, developers can define their own behavior for these events and customize the lifecycle of their gadgets accordingly.

    View Source

    OnDeviceOrientationChanged(DeviceOrientationEventArgs)

    Overrides this method if want to handle behavior when the device orientation is changed.

    Declaration
    protected virtual void OnDeviceOrientationChanged(DeviceOrientationEventArgs e)
    Parameters
    Type Name Description
    DeviceOrientationEventArgs e

    The device orientation changed event argument.

    Remarks

    This class provides functionality related to managing the lifecycle of a NUIGadget. It enables developers to handle events such as initialization, activation, deactivation, and destruction of the gadget. By implementing this class, developers can define their own behavior for these events and customize the lifecycle of their gadgets accordingly.

    View Source

    OnLocaleChanged(LocaleChangedEventArgs)

    Overrides this method if want to handle behavior when the system language is changed.

    Declaration
    protected virtual void OnLocaleChanged(LocaleChangedEventArgs e)
    Parameters
    Type Name Description
    LocaleChangedEventArgs e

    The locale changed event argument.

    Remarks

    This class provides functionality related to managing the lifecycle of a NUIGadget. It enables developers to handle events such as initialization, activation, deactivation, and destruction of the gadget. By implementing this class, developers can define their own behavior for these events and customize the lifecycle of their gadgets accordingly.

    View Source

    OnLowBattery(LowBatteryEventArgs)

    Overrides this method if want to handle behavior when the system battery is low.

    Declaration
    protected virtual void OnLowBattery(LowBatteryEventArgs e)
    Parameters
    Type Name Description
    LowBatteryEventArgs e

    The low batter event argument.

    Remarks

    This class provides functionality related to managing the lifecycle of a NUIGadget. It enables developers to handle events such as initialization, activation, deactivation, and destruction of the gadget. By implementing this class, developers can define their own behavior for these events and customize the lifecycle of their gadgets accordingly.

    View Source

    OnLowMemory(LowMemoryEventArgs)

    Overrides this method if want to handle behavior when the system memory is low.

    Declaration
    protected virtual void OnLowMemory(LowMemoryEventArgs e)
    Parameters
    Type Name Description
    LowMemoryEventArgs e

    The low memory event argument.

    Remarks

    This class provides functionality related to managing the lifecycle of a NUIGadget. It enables developers to handle events such as initialization, activation, deactivation, and destruction of the gadget. By implementing this class, developers can define their own behavior for these events and customize the lifecycle of their gadgets accordingly.

    View Source

    OnMessageReceived(NUIGadgetMessageReceivedEventArgs)

    Overrides this method if want to handle behavior when the message is received.

    Declaration
    protected virtual void OnMessageReceived(NUIGadgetMessageReceivedEventArgs e)
    Parameters
    Type Name Description
    NUIGadgetMessageReceivedEventArgs e

    The message received event argument.

    Remarks

    This class provides functionality related to managing the lifecycle of a NUIGadget. It enables developers to handle events such as initialization, activation, deactivation, and destruction of the gadget. By implementing this class, developers can define their own behavior for these events and customize the lifecycle of their gadgets accordingly.

    View Source

    OnPause()

    Overrides this method if want to handle behavior when the gadget is paused. If 'base.OnPause()' is not called. the event 'NUIGadgetLifecycleChanged' with the 'NUIGadgetLifecycleState.Paused' state will not be emitted.

    Declaration
    protected virtual void OnPause()
    Remarks

    This class provides functionality related to managing the lifecycle of a NUIGadget. It enables developers to handle events such as initialization, activation, deactivation, and destruction of the gadget. By implementing this class, developers can define their own behavior for these events and customize the lifecycle of their gadgets accordingly.

    View Source

    OnPreCreate()

    Override this method to define the behavior when the gadget is pre-created. Calling 'base.OnPreCreate()' is necessary in order to emit the 'NUIGadgetLifecycleChanged' event with the 'NUIGadgetLifecycleState.PreCreated' state.

    Declaration
    protected virtual void OnPreCreate()
    Remarks

    This class provides functionality related to managing the lifecycle of a NUIGadget. It enables developers to handle events such as initialization, activation, deactivation, and destruction of the gadget. By implementing this class, developers can define their own behavior for these events and customize the lifecycle of their gadgets accordingly.

    View Source

    OnRegionFormatChanged(RegionFormatChangedEventArgs)

    Overrides this method if want to handle behavior when the region format is changed.

    Declaration
    protected virtual void OnRegionFormatChanged(RegionFormatChangedEventArgs e)
    Parameters
    Type Name Description
    RegionFormatChangedEventArgs e

    The region format changed event argument.

    Remarks

    This class provides functionality related to managing the lifecycle of a NUIGadget. It enables developers to handle events such as initialization, activation, deactivation, and destruction of the gadget. By implementing this class, developers can define their own behavior for these events and customize the lifecycle of their gadgets accordingly.

    View Source

    OnResume()

    Overrides this method if want to handle behavior when the gadget is resumed. If 'base.OnResume()' is not called. the event 'NUIGadgetLifecycleChanged' with the 'NUIGadgetLifecycleState.Resumed' state will not be emitted.

    Declaration
    protected virtual void OnResume()
    Remarks

    This class provides functionality related to managing the lifecycle of a NUIGadget. It enables developers to handle events such as initialization, activation, deactivation, and destruction of the gadget. By implementing this class, developers can define their own behavior for these events and customize the lifecycle of their gadgets accordingly.

    View Source

    SendMessage(Bundle)

    Sends the message to the gadget. The message will be delived to the OnMessageReceived() method.

    Declaration
    public void SendMessage(Bundle message)
    Parameters
    Type Name Description
    Bundle message

    The message

    Remarks

    This class provides functionality related to managing the lifecycle of a NUIGadget. It enables developers to handle events such as initialization, activation, deactivation, and destruction of the gadget. By implementing this class, developers can define their own behavior for these events and customize the lifecycle of their gadgets accordingly.

    Events

    View Source

    OneShotServiceLifecycleChanged

    Occurs when the lifecycle of the OneShotService is changed.

    Declaration
    public event EventHandler<OneShotServiceLifecycleChangedEventArgs> OneShotServiceLifecycleChanged
    Event Type
    Type Description
    EventHandler<><OneShotServiceLifecycleChangedEventArgs>
    Remarks

    This event is raised when the state of OneShotService changes. It provides information about the current state through the OneShotServiceLifecycleChangedEventArgs argument.

    Explicit Interface Implementations

    View Source

    IUIGadget.ClassName

    Declaration
    string IUIGadget.ClassName { get; set; }
    Returns
    Type Description
    string
    Remarks

    This class provides functionality related to managing the lifecycle of a NUIGadget. It enables developers to handle events such as initialization, activation, deactivation, and destruction of the gadget. By implementing this class, developers can define their own behavior for these events and customize the lifecycle of their gadgets accordingly.

    View Source

    IUIGadget.MainView

    Declaration
    object IUIGadget.MainView { get; set; }
    Returns
    Type Description
    object
    Remarks

    This class provides functionality related to managing the lifecycle of a NUIGadget. It enables developers to handle events such as initialization, activation, deactivation, and destruction of the gadget. By implementing this class, developers can define their own behavior for these events and customize the lifecycle of their gadgets accordingly.

    View Source

    IUIGadget.OnAppControlReceived(AppControlReceivedEventArgs)

    Declaration
    void IUIGadget.OnAppControlReceived(AppControlReceivedEventArgs args)
    Parameters
    Type Name Description
    AppControlReceivedEventArgs args
    Remarks

    This class provides functionality related to managing the lifecycle of a NUIGadget. It enables developers to handle events such as initialization, activation, deactivation, and destruction of the gadget. By implementing this class, developers can define their own behavior for these events and customize the lifecycle of their gadgets accordingly.

    View Source

    IUIGadget.OnCreate()

    Declaration
    object IUIGadget.OnCreate()
    Returns
    Type Description
    object
    Remarks

    This class provides functionality related to managing the lifecycle of a NUIGadget. It enables developers to handle events such as initialization, activation, deactivation, and destruction of the gadget. By implementing this class, developers can define their own behavior for these events and customize the lifecycle of their gadgets accordingly.

    View Source

    IUIGadget.OnDestroy()

    Declaration
    void IUIGadget.OnDestroy()
    Remarks

    This class provides functionality related to managing the lifecycle of a NUIGadget. It enables developers to handle events such as initialization, activation, deactivation, and destruction of the gadget. By implementing this class, developers can define their own behavior for these events and customize the lifecycle of their gadgets accordingly.

    View Source

    IUIGadget.OnDeviceOrientationChanged(DeviceOrientationEventArgs)

    Declaration
    void IUIGadget.OnDeviceOrientationChanged(DeviceOrientationEventArgs args)
    Parameters
    Type Name Description
    DeviceOrientationEventArgs args
    Remarks

    This class provides functionality related to managing the lifecycle of a NUIGadget. It enables developers to handle events such as initialization, activation, deactivation, and destruction of the gadget. By implementing this class, developers can define their own behavior for these events and customize the lifecycle of their gadgets accordingly.

    View Source

    IUIGadget.OnLocaleChanged(LocaleChangedEventArgs)

    Declaration
    void IUIGadget.OnLocaleChanged(LocaleChangedEventArgs args)
    Parameters
    Type Name Description
    LocaleChangedEventArgs args
    Remarks

    This class provides functionality related to managing the lifecycle of a NUIGadget. It enables developers to handle events such as initialization, activation, deactivation, and destruction of the gadget. By implementing this class, developers can define their own behavior for these events and customize the lifecycle of their gadgets accordingly.

    View Source

    IUIGadget.OnLowBattery(LowBatteryEventArgs)

    Declaration
    void IUIGadget.OnLowBattery(LowBatteryEventArgs args)
    Parameters
    Type Name Description
    LowBatteryEventArgs args
    Remarks

    This class provides functionality related to managing the lifecycle of a NUIGadget. It enables developers to handle events such as initialization, activation, deactivation, and destruction of the gadget. By implementing this class, developers can define their own behavior for these events and customize the lifecycle of their gadgets accordingly.

    View Source

    IUIGadget.OnLowMemory(LowMemoryEventArgs)

    Declaration
    void IUIGadget.OnLowMemory(LowMemoryEventArgs args)
    Parameters
    Type Name Description
    LowMemoryEventArgs args
    Remarks

    This class provides functionality related to managing the lifecycle of a NUIGadget. It enables developers to handle events such as initialization, activation, deactivation, and destruction of the gadget. By implementing this class, developers can define their own behavior for these events and customize the lifecycle of their gadgets accordingly.

    View Source

    IUIGadget.OnMessageReceived(UIGadgetMessageReceivedEventArgs)

    Declaration
    void IUIGadget.OnMessageReceived(UIGadgetMessageReceivedEventArgs e)
    Parameters
    Type Name Description
    UIGadgetMessageReceivedEventArgs e
    Remarks

    This class provides functionality related to managing the lifecycle of a NUIGadget. It enables developers to handle events such as initialization, activation, deactivation, and destruction of the gadget. By implementing this class, developers can define their own behavior for these events and customize the lifecycle of their gadgets accordingly.

    View Source

    IUIGadget.OnPause()

    Declaration
    void IUIGadget.OnPause()
    Remarks

    This class provides functionality related to managing the lifecycle of a NUIGadget. It enables developers to handle events such as initialization, activation, deactivation, and destruction of the gadget. By implementing this class, developers can define their own behavior for these events and customize the lifecycle of their gadgets accordingly.

    View Source

    IUIGadget.OnPreCreate()

    Declaration
    void IUIGadget.OnPreCreate()
    Remarks

    This class provides functionality related to managing the lifecycle of a NUIGadget. It enables developers to handle events such as initialization, activation, deactivation, and destruction of the gadget. By implementing this class, developers can define their own behavior for these events and customize the lifecycle of their gadgets accordingly.

    View Source

    IUIGadget.OnRegionFormatChanged(RegionFormatChangedEventArgs)

    Declaration
    void IUIGadget.OnRegionFormatChanged(RegionFormatChangedEventArgs args)
    Parameters
    Type Name Description
    RegionFormatChangedEventArgs args
    Remarks

    This class provides functionality related to managing the lifecycle of a NUIGadget. It enables developers to handle events such as initialization, activation, deactivation, and destruction of the gadget. By implementing this class, developers can define their own behavior for these events and customize the lifecycle of their gadgets accordingly.

    View Source

    IUIGadget.OnResume()

    Declaration
    void IUIGadget.OnResume()
    Remarks

    This class provides functionality related to managing the lifecycle of a NUIGadget. It enables developers to handle events such as initialization, activation, deactivation, and destruction of the gadget. By implementing this class, developers can define their own behavior for these events and customize the lifecycle of their gadgets accordingly.

    View Source

    IUIGadget.State

    Declaration
    UIGadgetLifecycleState IUIGadget.State { get; set; }
    Returns
    Type Description
    UIGadgetLifecycleState
    Remarks

    This class provides functionality related to managing the lifecycle of a NUIGadget. It enables developers to handle events such as initialization, activation, deactivation, and destruction of the gadget. By implementing this class, developers can define their own behavior for these events and customize the lifecycle of their gadgets accordingly.

    View Source

    IUIGadget.UIGadgetInfo

    Declaration
    UIGadgetInfo IUIGadget.UIGadgetInfo { get; set; }
    Returns
    Type Description
    UIGadgetInfo
    Remarks

    This class provides functionality related to managing the lifecycle of a NUIGadget. It enables developers to handle events such as initialization, activation, deactivation, and destruction of the gadget. By implementing this class, developers can define their own behavior for these events and customize the lifecycle of their gadgets accordingly.

    View Source

    IUIGadget.UIGadgetResourceManager

    Declaration
    UIGadgetResourceManager IUIGadget.UIGadgetResourceManager { get; set; }
    Returns
    Type Description
    UIGadgetResourceManager
    Remarks

    This class provides functionality related to managing the lifecycle of a NUIGadget. It enables developers to handle events such as initialization, activation, deactivation, and destruction of the gadget. By implementing this class, developers can define their own behavior for these events and customize the lifecycle of their gadgets accordingly.

    Implements

    IUIGadget

    Extension Methods

    EXamlExtensions.LoadFromEXamlByRelativePath<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