Class ThemeManager

    Definition

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

    This static module provides methods that can manage NUI Theme.

    public static class ThemeManager
    Inheritance
    object
    ThemeManager
    Examples

    To apply custom theme to the application, try ApplyTheme(Theme).

    var customTheme = new Theme(res + "customThemeFile.xaml");
    ThemeManager.ApplyTheme(customTheme);

    Methods

    View Source

    ApplyTheme(Theme)

    Apply custom theme to the NUI. This will change the appearance of the existing components with property ThemeChangeSensitive on. This also affects all components created afterwards.

    Declaration
    public static void ApplyTheme(Theme theme)
    Parameters
    Type Name Description
    Theme theme

    The theme instance to be applied.

    Exceptions
    Type Condition
    System.ArgumentNullException

    Thrown when the given theme is null.

    View Source

    GetStyle(string)

    Load a style with style name in the current theme. For components, the default style name of a component is a component name with namespace (e.g. Tizen.NUI.Components.Button).

    Declaration
    public static ViewStyle GetStyle(string styleName)
    Parameters
    Type Name Description
    string styleName

    The style name.

    Returns
    Type Description
    ViewStyle
    Exceptions
    Type Condition
    System.ArgumentNullException

    Thrown when the given styleName is null.

    View Source

    GetStyle(Type)

    Load a style with view type in the current theme. If it failed to find a style with the given type, it will try with it's parent type until it succeeds.

    Declaration
    public static ViewStyle GetStyle(Type viewType)
    Parameters
    Type Name Description
    System.Type viewType

    The type of the view. Full name of the given type will be a key to find a style in the current theme. (e.g. Tizen.NUI.Components.Button)

    Returns
    Type Description
    ViewStyle
    Exceptions
    Type Condition
    System.ArgumentNullException

    Thrown when the given viewType is null.

    Events

    View Source

    ThemeChanged

    An event invoked after the theme has changed by ApplyTheme(Theme).

    Declaration
    public static event EventHandler<ThemeChangedEventArgs> ThemeChanged
    Event Type
    Type Description
    System.EventHandler<TEventArgs><ThemeChangedEventArgs>
    • View Source
    Back to top Copyright © 2016-2024 Samsung
    Generated by DocFX