Class StyleManager
Definition
- Namespace:
- Tizen.NUI
- Assembly:
- Tizen.NUI.dll
- API Level:
- 3
The StyleManager informs applications of the system theme change, and supports application theme change at runtime.
Applies various styles to controls using the properties system.
On theme change, it automatically updates all controls, then raises a event to inform the application.
If the application wants to customize the theme, RequestThemeChange needs to be called.
It provides the path to the application resource root folder, from there the filename can be specified along with any subfolders, for example, Images, Models, etc.
C#Copypublic class StyleManager : BaseHandle, INotifyPropertyChanged, IDynamicResourceHandler, IElement, INameScope, IElementController, IDisposable
- Inheritance
- Implements
-
System.ComponentModel.INotifyPropertyChangedSystem.IDisposable
Constructors
StyleManager()
Creates a StyleManager handle.
This can be initialized with StyleManager::Get().
Declaration
C#Copypublic StyleManager()
API Level: 3
Properties
Declaration
C#Copypublic static StyleManager Instance { get; }
Property Value
Type | Description |
---|---|
StyleManager |
API Level: 5
Methods
Declaration
C#Copypublic void AddConstant(string key, PropertyValue value)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key of the constant. |
PropertyValue | value | The value of the constant. |
API Level: 3
Declaration
C#Copypublic void ApplyDefaultTheme()
API Level: 3
Declaration
C#Copypublic void ApplyStyle(View control, string jsonFileName, string styleName)
Parameters
Type | Name | Description |
---|---|---|
View | control | The control to which to apply the style. |
System.String | jsonFileName | The name of the JSON style file to apply. |
System.String | styleName | The name of the style within the JSON file to apply. |
API Level: 3
ApplyTheme(String)
Applies a new theme to the application.
This will be merged on the top of the default Toolkit theme.
If the application theme file doesn't style all controls that the
application uses, then the default Toolkit theme will be used
instead for those controls.
Declaration
C#Copypublic void ApplyTheme(string themeFile)
Parameters
Type | Name | Description |
---|---|---|
System.String | themeFile | A relative path is specified for style theme. |
API Level: 3
Declaration
C#Copypublic static StyleManager Get()
Returns
Type | Description |
---|---|
StyleManager | A handle to the StyleManager control. |
API Level: 3
Declaration
C#Copypublic bool GetConstant(string key, PropertyValue valueOut)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key of the constant. |
PropertyValue | valueOut | The value of the constant if it exists. |
Returns
Type | Description |
---|---|
System.Boolean |
API Level: 3
Events
StyleChanged
An event for the StyleChanged signal which can be used to subscribe or unsubscribe the
event handler provided by the user.
The StyleChanged signal is emitted after the style (for example, theme or font change) has changed
and the controls have been informed.
Declaration
C#Copypublic event EventHandler<StyleManager.StyleChangedEventArgs> StyleChanged
Event Type
Type | Description |
---|---|
System.EventHandler<StyleManager.StyleChangedEventArgs> |