Class Theme

    Definition

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

    Basically, the Theme is a dictionary of ViewStyles that can decorate NUI Views. Each ViewStyle item is identified by a string key that can be matched the StyleName.

    The main purpose of providing theme is to separate style details from the structure. Managing style separately makes it easier to customize the look of application by user context. Also since a theme can be created from xaml file, it can be treated as a resource. This enables sharing styles with other applications.

    public class Theme : BindableObject, IDynamicResourceHandler, IResourcesProvider
    Inheritance
    object
    BindableObject
    Theme
    Implements
    IDynamicResourceHandler
    IResourcesProvider

    Constructors

    View Source

    Theme()

    The default constructor to create an empty theme.

    Declaration
    public Theme()
    View Source

    Theme(string)

    Create a new theme from the xaml file.

    Declaration
    public Theme(string xamlFile)
    Parameters
    Type Name Description
    string xamlFile

    An absolute path to the xaml file.

    Exceptions
    Type Condition
    XamlParseException

    Thrown when the content of the xaml file is not valid xaml form.

    Properties

    View Source

    BrokenImageUrl

    The url of broken image

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

    Id

    The string key to identify the Theme.

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

    IsResourcesCreated

    Check if resources created.

    Declaration
    public bool IsResourcesCreated { get; }
    Property Value
    Type Description
    bool
    View Source

    this[string]

    For Xaml use only. Note that it is not a normal indexer. Setter will merge the new value with existing item.

    Declaration
    public ViewStyle this[string styleName] { get; set; }
    Parameters
    Type Name Description
    string styleName
    Property Value
    Type Description
    ViewStyle
    View Source

    LargeBrokenImageUrl

    The url of large broken image

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

    SmallBrokenImageUrl

    The url of small broken image

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

    Version

    The version of the Theme.

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

    XamlResources

    Saved xaml resources.

    Declaration
    public ResourceDictionary XamlResources { get; set; }
    Property Value
    Type Description
    ResourceDictionary

    Methods

    View Source

    AddStyle(string, ViewStyle)

    Adds the specified style name and value to the theme. This replace existing value if the theme already has a style with given name.

    Declaration
    public void AddStyle(string styleName, ViewStyle value)
    Parameters
    Type Name Description
    string styleName

    The style name to add.

    ViewStyle value

    The style instance to add.

    View Source

    Clear()

    Removes all styles in the theme.

    Declaration
    public void Clear()
    View Source

    Clone()

    Declaration
    public object Clone()
    Returns
    Type Description
    object
    View Source

    GetEnumerator()

    Get an enumerator of the theme.

    Declaration
    public IEnumerator<KeyValuePair<string, ViewStyle>> GetEnumerator()
    Returns
    Type Description
    IEnumerator<><KeyValuePair<, ><string, ViewStyle>>
    View Source

    GetStyle(string)

    Gets a style of given style name.

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

    The string key to find a ViewStyle.

    Returns
    Type Description
    ViewStyle

    Found style instance if the style name has been found, otherwise null.

    View Source

    GetStyle(Type)

    Gets a style of given view type.

    Declaration
    public ViewStyle GetStyle(Type viewType)
    Parameters
    Type Name Description
    Type viewType

    The type of View.

    Returns
    Type Description
    ViewStyle

    Found style instance if the view type is found, otherwise null.

    View Source

    HasStyle(string)

    Determines whether the theme contains the specified style name.

    Declaration
    public bool HasStyle(string styleName)
    Parameters
    Type Name Description
    string styleName
    Returns
    Type Description
    bool
    View Source

    Merge(string)

    Merge other theme into this.

    Declaration
    public void Merge(string xamlFile)
    Parameters
    Type Name Description
    string xamlFile

    An absolute path to the xaml file of the theme.

    Exceptions
    Type Condition
    XamlParseException

    Thrown when the content of the xaml file is not valid xaml form.

    View Source

    Merge(Theme)

    Merge other theme into this.

    Declaration
    public void Merge(Theme theme)
    Parameters
    Type Name Description
    Theme theme

    The theme to be merged with this theme.

    View Source

    RemoveStyle(string)

    Removes the style with the specified style name.

    Declaration
    public bool RemoveStyle(string styleName)
    Parameters
    Type Name Description
    string styleName
    Returns
    Type Description
    bool

    Implements

    IDynamicResourceHandler
    IResourcesProvider

    Extension Methods

    BindableObjectExtensions.SetBinding(BindableObject, BindableProperty, string, BindingMode, IValueConverter, string)
    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