Class Notification
Definition
- Namespace:
- Tizen.NUI.Components
- Assembly:
- Tizen.NUI.Components.dll
Notification helps to raise a notification window with a content View.
C#Copypublic class Notification : Disposable, IDisposable
- Inheritance
- Implements
-
System.IDisposable
Constructors
Declaration
C#Copypublic Notification(View contentView)
Parameters
Type | Name | Description |
---|---|---|
View | contentView | The content view instance to display in the notification window. |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown when the device does not support a notification feature. |
System.ArgumentNullException | Thrown when a given contentView is null. |
Properties
Declaration
C#Copypublic View ContentView { get; }
Property Value
Type | Description |
---|---|
View |
Methods
Declaration
C#Copypublic void Dismiss()
Declaration
C#Copyprotected override void Dispose(DisposeTypes type)
Parameters
Type | Name | Description |
---|---|---|
DisposeTypes | type |
Overrides
ForceQuit()
Dismiss the notification window directly without waiting the onDismissAnimation finished.
Declaration
C#Copypublic void ForceQuit()
Declaration
C#Copypublic 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.
CopyNotification.MakeToast("Hello World!", Notification.ToastBottom).Post(Notification.ToastShort);
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown when the device does not support a notification feature. |
System.ArgumentNullException | Thrown when the given text or gravity is null. |
Declaration
C#Copypublic void Post(uint duration = 0)
Parameters
Type | Name | Description |
---|---|---|
uint | duration | Dismiss the notification window after given time in millisecond. The value 0 won't dismiss the notification. |
Exceptions
Type | Condition |
---|---|
System.UnauthorizedAccessException | Thrown when the application does not have proper privilege. |
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#Copypublic Notification SetAnimationOnDismiss(Animation animation)
Parameters
Type | Name | Description |
---|---|---|
Animation | animation | The animation to play. |
Returns
Type | Description |
---|---|
Notification |
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#Copypublic Notification SetAnimationOnPost(Animation animation)
Parameters
Type | Name | Description |
---|---|---|
Animation | animation | The animation to play. |
Returns
Type | Description |
---|---|
Notification |
SetLevel(NotificationLevel)
Sets a priority level for the specified notification window. The default level is NotificationLevel.Base.
Declaration
C#Copypublic 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 |
---|---|
System.UnauthorizedAccessException | Thrown when the application does not have proper privilege. |
Declaration
C#Copypublic 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 |
---|---|
System.ArgumentException | Thrown when a given positionSize is invalid. |