Definition
- Namespace:
- Tizen.NUI.Components
- Assembly:
- Tizen.NUI.Components.dll
- API Level:
- 8
Notification helps to raise a notification window with a content View.
public class Notification : Disposable
- Inheritance
-
Constructors
View Source
Notification(View)
Create a notification with a content View.
Declaration
public Notification(View contentView)
Parameters
Type |
Name |
Description |
View |
contentView |
The content view instance to display in the notification window.
|
API Level: 8
Fields
View Source
ToastBottom
Toast will appear at the bottom of the screen.
Declaration
public static readonly Position ToastBottom
Field Value
View Source
ToastCenter
Toast will appear at the center of the screen.
Declaration
public static readonly Position ToastCenter
Field Value
View Source
ToastLong
Show the notification for a long period of time.
Declaration
public static readonly uint ToastLong
Field Value
View Source
ToastShort
Show the notification for a short period of time.
Declaration
public static readonly uint ToastShort
Field Value
View Source
ToastTop
Toast will appear at the top of the screen.
Declaration
public static readonly Position ToastTop
Field Value
Properties
View Source
ContentView
The content view received in a constructor.
Declaration
public View ContentView { get; }
Property Value
API Level: 8
Methods
Declaration
API Level: 8
Declaration
protected override void Dispose(DisposeTypes type)
Parameters
Overrides
API Level: 8
View Source
ForceQuit()
Dismiss the notification window directly without waiting the onDismissAnimation finished.
Declaration
API Level: 8
View Source
MakeToast(String, Position)
Create a simple text notification called toast.
Declaration
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.
Notification.MakeToast("Hello World!", Notification.ToastBottom).Post(Notification.ToastShort);
API Level: 9
View Source
Post(UInt32)
Post a notification window with the content view.
Declaration
public void Post(uint duration = null)
Parameters
Type |
Name |
Description |
UInt32 |
duration |
Dismiss the notification window after given time in millisecond. The value 0 won't dismiss the notification.
|
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
public Notification SetAnimationOnDismiss(Animation animation)
Parameters
Type |
Name |
Description |
Animation |
animation |
The animation to play.
|
Returns
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
public Notification SetAnimationOnPost(Animation animation)
Parameters
Type |
Name |
Description |
Animation |
animation |
The animation to play.
|
Returns
API Level: 8
View Source
SetDismissOnTouch(Boolean)
Sets whether listen to touch event to dismiss notification window.
Declaration
public Notification SetDismissOnTouch(bool dismissOnTouch)
Parameters
Type |
Name |
Description |
Boolean |
dismissOnTouch |
Dismiss notification window on touch if the value is true.
|
Returns
Type |
Description |
Notification |
The current Notification instance.
|
View Source
SetLevel(NotificationLevel)
Sets a priority level for the specified notification window.
The default level is NotificationLevel.Base.
Declaration
public Notification SetLevel(NotificationLevel level)
Parameters
Returns
Type |
Description |
Notification |
The current Notification instance.
|
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
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.
|
API Level: 8
Extension Methods