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);

    Fields

    View Source

    DefaultDarkThemeName

    The default dark theme name preloaded in platform.

    Declaration
    public const string DefaultDarkThemeName
    Field Value
    Type Description
    string
    View Source

    DefaultLightThemeName

    The default light theme name preloaded in platform.

    Declaration
    public const string DefaultLightThemeName
    Field Value
    Type Description
    string

    Properties

    View Source

    PlatformThemeId

    The current platform theme Id. Note that it returns null when the platform theme is disabled. If the PlatformThemeEnabled is given, it can be one of followings in tizen 6.5:

    • org.tizen.default-light-theme
    • org.tizen.default-dark-theme
    Declaration
    public static string PlatformThemeId { get; }
    Property Value
    Type Description
    string
    View Source

    ThemeId

    The current theme Id. It returns null when no theme is applied.

    Declaration
    public static string ThemeId { get; }
    Property Value
    Type Description
    string

    Methods

    View Source

    AppendBaseTheme(Theme)

    Append a theme to the current base theme and apply it. This will change the appearance of the existing components with property ThemeChangeSensitive on. This also affects all components created afterwards.

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

    The theme instance to be appended.

    View Source

    AppendTheme(Theme)

    Append a theme to the current theme and apply it. This will change the appearance of the existing components with property ThemeChangeSensitive on. This also affects all components created afterwards.

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

    The theme instance to be appended.

    View Source

    ApplyPlatformTheme(string)

    Change tizen theme. User may change this to one of platform installed one. Note that this is global theme changing which effects all applications.

    Declaration
    public static bool ApplyPlatformTheme(string themeId)
    Parameters
    Type Name Description
    string themeId

    The installed theme Id.

    Returns
    Type Description
    bool

    true on success, false when it failed to find installed theme with given themeId.

    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.

    View Source

    GetPlatformStyle(string)

    Load a platform style with style name in the current theme. It returns null when the platform theme is disabled. PlatformThemeEnabled.

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

    The style name.

    Returns
    Type Description
    ViewStyle
    View Source

    GetPlatformStyle(Type)

    Load a platform style with view type in the current theme. It returns null when the platform theme is disabled. PlatformThemeEnabled.

    Declaration
    public static ViewStyle GetPlatformStyle(Type viewType)
    Parameters
    Type Name Description
    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
    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
    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
    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

    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
    EventHandler<><ThemeChangedEventArgs>
    View Source

    ThemeChanging

    An event invoked when the theme is about to change (not applied to the views yet).

    Declaration
    public static event EventHandler<ThemeChangedEventArgs> ThemeChanging
    Event Type
    Type Description
    EventHandler<><ThemeChangedEventArgs>
    • View Source
    Back to top Copyright © 2016-2025 Samsung
    Generated by DocFX