Class NUIApplication
Definition
- Assembly:
- Tizen.NUI.dll
Represents an application that have a UI screen. The NUIApplication class has a default stage.
public class NUIApplication : CoreApplication
- Inheritance
Constructors
View SourceNUIApplication()
Initializes a new instance of the NUIApplication class. This is the default constructor that initializes the NUI application using the NUICoreBackend.
Declaration
public NUIApplication()
NUIApplication(string, WindowMode, CoreTask)
The constructor with a stylesheet, window mode, coretask
Declaration
public NUIApplication(string styleSheet, NUIApplication.WindowMode windowMode, CoreTask task)
Parameters
| Type | Name | Description |
|---|---|---|
| string | styleSheet | The styleSheet URL. |
| NUIApplication.WindowMode | windowMode | The windowMode. |
| CoreTask | task | True If app creates a UI Thread |
NUIApplication(string, WindowMode, Size2D, Position2D, CoreTask)
The constructor with a stylesheet, window mode, window size, position, coretask
Declaration
public NUIApplication(string styleSheet, NUIApplication.WindowMode windowMode, Size2D windowSize, Position2D windowPosition, CoreTask task)
Parameters
| Type | Name | Description |
|---|---|---|
| string | styleSheet | The styleSheet URL. |
| NUIApplication.WindowMode | windowMode | The windowMode. |
| Size2D | windowSize | The window size. |
| Position2D | windowPosition | The window position. |
| CoreTask | task | True If app creates a UI Thread |
NUIApplication(string, WindowMode, Size2D, Position2D)
The constructor with a stylesheet, window mode, window size, and position.
Declaration
public NUIApplication(string styleSheet, NUIApplication.WindowMode windowMode, Size2D windowSize, Position2D windowPosition)
Parameters
| Type | Name | Description |
|---|---|---|
| string | styleSheet | The styleSheet URL. |
| NUIApplication.WindowMode | windowMode | The windowMode. |
| Size2D | windowSize | The window size. |
| Position2D | windowPosition | The window position. |
NUIApplication(string, WindowMode, WindowType)
The constructor with a stylesheet, window mode and default window type. It is the only way to create an IME window.
Declaration
public NUIApplication(string styleSheet, NUIApplication.WindowMode windowMode, WindowType type)
Parameters
| Type | Name | Description |
|---|---|---|
| string | styleSheet | The styleSheet URL. |
| NUIApplication.WindowMode | windowMode | The windowMode. |
| WindowType | type | The default window type. |
NUIApplication(string, WindowMode)
The constructor with a stylesheet and window mode. This constructor initializes the NUIApplication with a specified stylesheet and window mode.
Declaration
public NUIApplication(string styleSheet, NUIApplication.WindowMode windowMode)
Parameters
| Type | Name | Description |
|---|---|---|
| string | styleSheet | The styleSheet url. |
| NUIApplication.WindowMode | windowMode | The windowMode. |
NUIApplication(string, Size2D, Position2D, IBorderInterface, WindowMode)
The constructor with a stylesheet, size, position, boderInterface and window mode
Declaration
public NUIApplication(string styleSheet, Size2D windowSize, Position2D windowPosition, IBorderInterface borderInterface, NUIApplication.WindowMode windowMode = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | styleSheet | The styleSheet URL. |
| Size2D | windowSize | The window size. |
| Position2D | windowPosition | The window position. |
| IBorderInterface | borderInterface | IBorderInterfaceIf borderInterface is null, defaultBorder is enabled. |
| NUIApplication.WindowMode | windowMode | The windowMode. |
NUIApplication(string, Size2D, Position2D)
The constructor with a stylesheet, window size, and position.
Declaration
public NUIApplication(string styleSheet, Size2D windowSize, Position2D windowPosition)
Parameters
| Type | Name | Description |
|---|---|---|
| string | styleSheet | The styleSheet URL. |
| Size2D | windowSize | The window size. |
| Position2D | windowPosition | The window position. |
NUIApplication(string)
The constructor with a stylesheet. This constructor initializes a new instance of the Tizen.NUI.NUIApplication class with the specified stylesheet.
Declaration
public NUIApplication(string styleSheet)
Parameters
| Type | Name | Description |
|---|---|---|
| string | styleSheet | The URL of the stylesheet to apply to the application. |
NUIApplication(BackendType, WindowMode, Size2D, Position2D, string)
Internal inhouse constructor with Graphics Backend Type
Declaration
public NUIApplication(Graphics.BackendType backend, NUIApplication.WindowMode windowMode = default, Size2D windowSize = null, Position2D windowPosition = null, string styleSheet = "")
Parameters
| Type | Name | Description |
|---|---|---|
| Graphics.BackendType | backend | |
| NUIApplication.WindowMode | windowMode | |
| Size2D | windowSize | |
| Position2D | windowPosition | |
| string | styleSheet |
NUIApplication(ThemeOptions, IBorderInterface)
The constructor with theme option and borderInterface.
Declaration
public NUIApplication(NUIApplication.ThemeOptions option, IBorderInterface borderInterface)
Parameters
| Type | Name | Description |
|---|---|---|
| NUIApplication.ThemeOptions | option | The theme option. |
| IBorderInterface | borderInterface | IBorderInterfaceIf borderInterface is null, defaultBorder is enabled. |
NUIApplication(ThemeOptions, WindowData)
The constructor with a ThemeOptions, WindowData
Declaration
public NUIApplication(NUIApplication.ThemeOptions option, WindowData windowData)
Parameters
| Type | Name | Description |
|---|---|---|
| NUIApplication.ThemeOptions | option | The theme option. |
| WindowData | windowData | The default window data |
NUIApplication(ThemeOptions)
The constructor with theme option.
Declaration
public NUIApplication(NUIApplication.ThemeOptions option)
Parameters
| Type | Name | Description |
|---|---|---|
| NUIApplication.ThemeOptions | option | The theme option. |
NUIApplication(Size2D, Position2D, ThemeOptions, IBorderInterface)
The constructor with window size, position, theme option and borderInterface.
Declaration
public NUIApplication(Size2D windowSize, Position2D windowPosition, NUIApplication.ThemeOptions option, IBorderInterface borderInterface)
Parameters
| Type | Name | Description |
|---|---|---|
| Size2D | windowSize | The window size. |
| Position2D | windowPosition | The window position. |
| NUIApplication.ThemeOptions | option | The theme option. |
| IBorderInterface | borderInterface | IBorderInterfaceIf borderInterface is null, defaultBorder is enabled. |
NUIApplication(Size2D, Position2D, ThemeOptions)
The constructor with window size and position and theme option.
Declaration
public NUIApplication(Size2D windowSize, Position2D windowPosition, NUIApplication.ThemeOptions option)
Parameters
| Type | Name | Description |
|---|---|---|
| Size2D | windowSize | The window size. |
| Position2D | windowPosition | The window position. |
| NUIApplication.ThemeOptions | option | The theme option. |
NUIApplication(Size2D, Position2D)
The constructor with window size and position.
Declaration
public NUIApplication(Size2D windowSize, Position2D windowPosition)
Parameters
| Type | Name | Description |
|---|---|---|
| Size2D | windowSize | The window size. |
| Position2D | windowPosition | The window position. |
Properties
View SourceAppId
Gets the Application Id.
Declaration
public string AppId { get; }
Property Value
| Type | Description |
|---|---|
| string |
CurrentLoadedXaml
Current loaded xaml's full name.
Declaration
public static string CurrentLoadedXaml { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
IsUsingIncrementalDispose
Set to true if NUI DisposeQueue dispose items incrementally. The default value is false.
Declaration
public static bool IsUsingIncrementalDispose { get; }
Property Value
| Type | Description |
|---|---|
| bool |
IsUsingThemeManager
Set to true if NUI ThemeManager is used. The default value is true.
Declaration
public static bool IsUsingThemeManager { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
IsUsingXaml
Set to true if XAML is used. This must be called before or immediately after the NUIApplication constructor is called. The default value is true.
Declaration
public static bool IsUsingXaml { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Remarks
This must be called before or immediately after the NUIApplication constructor is called.
MultilingualResourceManager
The MultilingualResourceManager property provides access to a System.Resources.ResourceManager instance that can be used to manage resources for different languages.
Declaration
public static System.Resources.ResourceManager MultilingualResourceManager { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Resources.ResourceManager |
State
Gets the state of current application.
Declaration
public NUIApplication.States State { get; }
Property Value
| Type | Description |
|---|---|
| NUIApplication.States |
SupportPreInitializedCreation
Whether current system support to create view at Preload time.
Declaration
public static bool SupportPreInitializedCreation { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Window
Gets the window instance.
Declaration
public Window Window { get; }
Property Value
| Type | Description |
|---|---|
| Window |
Methods
View SourceAddIdle(Delegate)
Ensures that the function passed in is called from the main loop when it is idle.
Declaration
public bool AddIdle(System.Delegate func)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Delegate | func | The function to call |
Returns
| Type | Description |
|---|---|
| bool | true if added successfully, false otherwise |
Exit()
Exits the NUIApplication. This method causes the application to terminate gracefully.
Declaration
public override void Exit()
Overrides
Remarks
This method does not quit the application immediately. It waits until all pending events are completely processed, then registers a termination request during the main loop's idle state and executes the termination at that time.
FlushUpdateMessages()
Flush render/update thread messages synchronously.
Declaration
public void FlushUpdateMessages()
Remarks
This function will relayout forcibily. This function is used for advanced developer. It will make main-thread overhead if you call this function frequencely.
GetAvailableScreens()
Retrieves a list of all currently available screens. This function queries the window system for all connected and active screens, providing essential information for each. It is primarily intended for use in multi-screen environments where an application might need to manage windows across different displays.
Declaration
public static ScreenInformation[] GetAvailableScreens()
Returns
| Type | Description |
|---|---|
| ScreenInformation[] | The array of screen information |
GetDefaultWindow()
Gets the default window.
Declaration
public static Window GetDefaultWindow()
Returns
| Type | Description |
|---|---|
| Window | The default Window. |
GetScreenSize()
Gets the screen size
Declaration
public static Size GetScreenSize()
Returns
| Type | Description |
|---|---|
| Size | Screen size |
IsGeometryHittestEnabled()
Checks whether geometry hit-testing is enabled for the application.
Declaration
public static bool IsGeometryHittestEnabled()
Returns
| Type | Description |
|---|---|
| bool | True if geometry hit-testing is enabled, false otherwise. |
OnAppControlReceived(AppControlReceivedEventArgs)
This method is overridden to handle the application control event received.
Declaration
protected override void OnAppControlReceived(AppControlReceivedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| AppControlReceivedEventArgs | e | The event arguments containing the received application control. |
Overrides
View SourceOnCreate()
The OnCreate method of NUIApplication class. This method is called when the application is created. Override this method to handle custom initialization logic.
Declaration
protected override void OnCreate()
Overrides
View SourceOnDeviceOrientationChanged(DeviceOrientationEventArgs)
This method is to handle behavior when the device orientation is changed. When device is rotated to ccw or cw, this event occurs. In addition, this event is different to window orientation changed event. The window orientation event is for per a window and occurs when some flags should be set before.
Declaration
protected override void OnDeviceOrientationChanged(DeviceOrientationEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| DeviceOrientationEventArgs | e | The device orientation changed event argument |
Overrides
View SourceOnLocaleChanged(LocaleChangedEventArgs)
The OnLocaleChanged method is called when the system locale settings have changed. Overrides this method if you want to handle behavior.
Declaration
protected override void OnLocaleChanged(LocaleChangedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| LocaleChangedEventArgs | e | The event arguments containing the new locale information. |
Overrides
View SourceOnLowBattery(LowBatteryEventArgs)
The OnLowBattery method is called when the system is under Low Battery status. Overrides this method if you want to handle behavior.
Declaration
protected override void OnLowBattery(LowBatteryEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| LowBatteryEventArgs | e | The event arguments containing the battery status. |
Overrides
View SourceOnLowMemory(LowMemoryEventArgs)
The OnLowMemory method is called when the system is under Low Memory status. Overrides this method if you want to handle behavior.
Declaration
protected override void OnLowMemory(LowMemoryEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| LowMemoryEventArgs | e | The event arguments containing low memory status information. |
Overrides
View SourceOnPause()
Overrides this method if you want to handle behavior when the application is paused.
Declaration
protected virtual void OnPause()
OnPreCreate()
Overrides this method if you want to handle behavior before the application is created. This method is guaranteed to be called before OnCreate() is called.
Declaration
protected virtual void OnPreCreate()
OnRegionFormatChanged(RegionFormatChangedEventArgs)
This method is called when the system's region format settings have changed. It provides an opportunity to handle any necessary adjustments or updates based on the new region format. Overrides this method if you want to handle behavior.
Declaration
protected override void OnRegionFormatChanged(RegionFormatChangedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| RegionFormatChangedEventArgs | e | The event arguments containing information about the region format change. |
Overrides
View SourceOnResume()
Overrides this method if you want to handle behavior when the application is resumed.
Declaration
protected virtual void OnResume()
OnTerminate()
This method is called when the application is terminated. Overrides this method if you want to handle behavior.
Declaration
protected override void OnTerminate()
Overrides
View SourcePreload()
This is used to improve application launch performance.
Declaration
public static void Preload()
RegisterAssembly(Assembly)
Registers the specified assembly to XAML, allowing types within the assembly to be used in XAML files.
Declaration
public static void RegisterAssembly(Assembly assembly)
Parameters
| Type | Name | Description |
|---|---|---|
| Assembly | assembly | The assembly to register. |
RemoveIdle(Delegate)
Remove delegate what we added by AddIdle.
Declaration
public void RemoveIdle(System.Delegate func)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Delegate | func | The function to remove |
Run(string[])
This method starts the main loop of the application, allowing it to receive events and run its lifecycle.
Declaration
public override void Run(string[] args)
Parameters
| Type | Name | Description |
|---|---|---|
| string[] | args | Arguments from commandline. These arguments can be used to customize the application behavior at startup. |
Overrides
Examples
static void Main(string[] args)
{
NUIApplication app = new NUIApplication();
app.Run(args);
}
View Source
SetGeometryHittestEnabled(bool)
Sets the geometry hit-testing enabled or disabled for the application.
Declaration
public static void SetGeometryHittestEnabled(bool enable)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | enable | True to enable geometry hit-testing, false otherwise. |
SetMaximumRenderFrameRate(float)
Set the maximum value of frames per seconds.
Declaration
public static void SetMaximumRenderFrameRate(float maximumRenderFrameRate)
Parameters
| Type | Name | Description |
|---|---|---|
| float | maximumRenderFrameRate | The maximum fps for this adaptor system. |
Remarks
Each frame will render multiple of given maximum render frame rate. For example, if maximumRenderFrameRate = 50.0f, each elapse time could be 20ms, 40ms, 60ms, and so on.
SetRenderRefreshRate(uint)
Sets the number of frames per render.
Declaration
public static void SetRenderRefreshRate(uint numberOfVSyncsPerRender)
Parameters
| Type | Name | Description |
|---|---|---|
| uint | numberOfVSyncsPerRender | The number of vsyncs between successive renders. |
Remarks
Suggest this is a power of two:
1 - render each vsync frame.
2 - render every other vsync frame.
4 - render every fourth vsync frame.
8 - render every eighth vsync frame.
For example, if an application runs on 60 FPS and SetRenderRefreshRate(2) is called, the frames per second will be changed to 30.
Events
View SourcePaused
The event handler that gets called when the application is paused. This event is triggered when the application transitions to a paused state.
Declaration
public event EventHandler Paused
Event Type
| Type | Description |
|---|---|
| EventHandler |
Examples
NUIApplication app = new NUIApplication();
app.Paused += OnAppPaused;
void OnAppPaused(object sender, EventArgs e)
{
// Perform actions when the application is paused
}
View Source
Resumed
The Resumed event handler. This event is triggered when the application resumes from being paused or stopped. It can be used to perform actions that need to be executed when the application becomes active again.
Declaration
public event EventHandler Resumed
Event Type
| Type | Description |
|---|---|
| EventHandler |
Examples
NUIApplication app = new NUIApplication();
app.Resumed += OnAppResumed;
void OnAppResumed(object sender, EventArgs e)
{
// Perform actions when the application is resumed
}
View Source
XamlLoaded
Xaml loaded event.
Declaration
public static event NUIApplication.XamlLoadedHandler XamlLoaded
Event Type
| Type | Description |
|---|---|
| NUIApplication.XamlLoadedHandler |