Class Theme
Definition
- 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.
C#Copypublic class Theme : BindableObject, INotifyPropertyChanged
- Inheritance
-
objectTizen.NUI.Binding.BindableObjectTheme
- Implements
-
System.ComponentModel.INotifyPropertyChanged
Constructors
Declaration
C#Copypublic Theme()
Declaration
C#Copypublic Theme(string xamlFile)
Parameters
| Type | Name | Description |
|---|---|---|
| string | xamlFile | An absolute path to the xaml file. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown when the given xamlFile is null or empty string. |
| System.IO.IOException | Thrown when there are file IO problems. |
| Tizen.NUI.Xaml.XamlParseException | Thrown when the content of the xaml file is not valid xaml form. |
Properties
Declaration
C#Copypublic string Id { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Declaration
C#Copypublic string Version { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
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
C#Copypublic void AddStyle(string styleName, ViewStyle value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | styleName | The style name to add. |
| ViewStyle | value | The style instance to add. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown when the given styleName is null. |
Declaration
C#Copypublic object Clone()
Returns
| Type | Description |
|---|---|
| object |
Declaration
C#Copypublic 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. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown when the given styleName is null. |
Declaration
C#Copypublic ViewStyle GetStyle(Type viewType)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | viewType | The type of View. |
Returns
| Type | Description |
|---|---|
| ViewStyle | Found style instance if the view type is found, otherwise null. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown when the given viewType is null. |
Declaration
C#Copypublic void Merge(Theme theme)
Parameters
| Type | Name | Description |
|---|---|---|
| Theme | theme | The theme to be merged with this theme. |