Class Notification

Definition

Namespace:
Tizen.NUI.Components
Assembly:
Tizen.NUI.Components.dll
API Level:
8

Notification helps to raise a notification window with a content View.

C#
Copy
public class Notification : Disposable, IDisposable
Inheritance
Notification
Implements

Constructors

View Source

Notification(View)

Create a notification with a content View.

Declaration
C#
Copy
public Notification(View contentView)
Parameters
Type Name Description
View contentView

The content view instance to display in the notification window.

Exceptions
Type Condition
NotSupportedException

Thrown when the device does not support a notification feature.

ArgumentNullException

Thrown when a given contentView is null.

API Level: 8

Properties

View Source

ContentView

The content view received in a constructor.

Declaration
C#
Copy
public View ContentView { get; }
Property Value
Type Description
View
API Level: 8

Methods

View Source

Dismiss()

Dismiss the notification window.

Declaration
C#
Copy
public void Dismiss()
API Level: 8
View Source

Dispose(DisposeTypes)

Dispose.

Declaration
C#
Copy
protected override void Dispose(DisposeTypes type)
Parameters
Type Name Description
DisposeTypes type
Overrides
API Level: 8
View Source

ForceQuit()

Dismiss the notification window directly without waiting the onDismissAnimation finished.

Declaration
C#
Copy
public void ForceQuit()
API Level: 8
View Source

MakeToast(String, Position)

Create a simple text notification called toast.

Declaration
C#
Copy
public static Notification MakeToast(string text, Position gravity)
Parameters
Type Name Description
String text

The string content.

Position gravity

The location at which the toast should appear. It's one of the notification constants: ToastTop, ToastCenter and ToastBottom.

Returns
Type Description
Notification

The created Notification instance.

Examples

The following example demonstrates how to make a toast at the bottom and show it for a short period time.

Copy
Notification.MakeToast("Hello World!", Notification.ToastBottom).Post(Notification.ToastShort);
Exceptions
Type Condition
NotSupportedException

Thrown when the device does not support a notification feature.

ArgumentNullException

Thrown when the given text or gravity is null.

API Level: 9
View Source

Post(UInt32)

Post a notification window with the content view.

Declaration
C#
Copy
public void Post(uint duration = 0U)
Parameters
Type Name Description
UInt32 duration

Dismiss the notification window after given time in millisecond. The value 0 won't dismiss the notification.

Exceptions
Type Condition
UnauthorizedAccessException

Thrown when the application does not have proper privilege.

API Level: 8
Privilege Level: public
Privilege: http://tizen.org/privilege/window.priority.set
View Source

SetAnimationOnDismiss(Animation)

Sets a user-defined animation to play when dismiss the notification. On dismiss, the given animation is played, and after the playback is completed the notification window is undisplayed.

Declaration
C#
Copy
public Notification SetAnimationOnDismiss(Animation animation)
Parameters
Type Name Description
Animation animation

The animation to play.

Returns
Type Description
Notification
API Level: 8
View Source

SetAnimationOnPost(Animation)

Sets a user-defined animation to play when posting the notification. The Notification will play the given animation right after the notification window pops up.

Declaration
C#
Copy
public Notification SetAnimationOnPost(Animation animation)
Parameters
Type Name Description
Animation animation

The animation to play.

Returns
Type Description
Notification
API Level: 8
View Source

SetLevel(NotificationLevel)

Sets a priority level for the specified notification window. The default level is NotificationLevel.Base.

Declaration
C#
Copy
public Notification SetLevel(NotificationLevel level)
Parameters
Type Name Description
NotificationLevel level

The notification window level.

Returns
Type Description
Notification

The current Notification instance.

Exceptions
Type Condition
UnauthorizedAccessException

Thrown when the application does not have proper privilege.

API Level: 8
Privilege Level: public
Privilege: http://tizen.org/privilege/window.priority.set
View Source

SetPositionSize(Rectangle)

Sets position and size of the notification window.

Declaration
C#
Copy
public Notification SetPositionSize(Rectangle positionSize)
Parameters
Type Name Description
Rectangle positionSize

The position and size information in rectangle.

Returns
Type Description
Notification

The current Notification instance.

Exceptions
Type Condition
ArgumentException

Thrown when a given positionSize is invalid.

API Level: 8

Implements