Class Notification
Definition
- Namespace:
- Tizen.Applications.Notifications
- Assembly:
- Tizen.Applications.Notification.dll
This class contains common properties and methods of notifications.
public sealed class Notification : IDisposable
- Inheritance
-
objectNotification
- Implements
-
System.IDisposable
Remarks
A notification is a message that is displayed on the notification area. It is created to notify information to the user through the application. This class helps you to provide method and property for creating notification object.
Constructors
View SourceNotification()
Initializes a new instance of the Notification class.
Declaration
public Notification()
Remarks
A notification is a message that is displayed on the notification area. It is created to notify information to the user through the application. This class helps you to provide method and property for creating notification object.
Properties
View SourceAccessory
Gets or sets Notification.AccessorySet which is included vibration, LED and sound option to be applied at notification.
Declaration
public Notification.AccessorySet Accessory { get; set; }
Property Value
Type | Description |
---|---|
Notification.AccessorySet |
Remarks
If you set it to null, the already set AccessorySet will be initialized.
Examples
Notification notification = new Notification
{
Title = "Notification",
Content = "Hello Tizen",
Icon = "Icon path",
Count = 3
};
Notification.AccessorySet accessory = new Notification.AccessorySet
{
SoundOption = AccessoryOption.Custom,
SoundPath = "Sound File Path",
IsVibration = true,
LedOption = AccessoryOption.Custom,
LedOnMs = 100;
LedOffMs = 50;
LedColor = Color.Lime
};
notification.Accessory = accessory;
NotificationManager.Post(notification);
View Source
Action
Gets or sets action, which is invoked when the notification is clicked.
Declaration
public AppControl Action { get; set; }
Property Value
Type | Description |
---|---|
AppControl |
Remarks
If you set it to null, the already set AppControl will be removed and nothing will happen when you click on notification.
See Also
View SourceContent
Gets or sets the content of notification.
Declaration
public string Content { get; set; }
Property Value
Type | Description |
---|---|
string |
Remarks
A notification is a message that is displayed on the notification area. It is created to notify information to the user through the application. This class helps you to provide method and property for creating notification object.
Count
Gets or sets count, which is displayed at the right side of the notification.
Declaration
public int Count { get; set; }
Property Value
Type | Description |
---|---|
int |
Remarks
You must set only positive number. If you set count to negative number, this property throws exception.
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when argument is invalid. |
Icon
Gets or sets the icon of notification. You should set an absolute path for an image file.
Declaration
public string Icon { get; set; }
Property Value
Type | Description |
---|---|
string |
Remarks
A notification is a message that is displayed on the notification area. It is created to notify information to the user through the application. This class helps you to provide method and property for creating notification object.
IsTimeStampVisible
Gets or sets a value indicating whether TimeStamp of the notification is Visible or not. Default to true.
Declaration
public bool IsTimeStampVisible { get; set; }
Property Value
Type | Description |
---|---|
bool |
Remarks
A notification is a message that is displayed on the notification area. It is created to notify information to the user through the application. This class helps you to provide method and property for creating notification object.
IsVisible
Gets or sets a value indicating whether notification is displayed on the default viewer. If you set false and add style, you can see only style notification.
Declaration
public bool IsVisible { get; set; }
Property Value
Type | Description |
---|---|
bool |
Remarks
A notification is a message that is displayed on the notification area. It is created to notify information to the user through the application. This class helps you to provide method and property for creating notification object.
Progress
Gets or sets Notification.ProgressType object for display at notification.
Declaration
public Notification.ProgressType Progress { get; set; }
Property Value
Type | Description |
---|---|
Notification.ProgressType |
Remarks
A notification is a message that is displayed on the notification area. It is created to notify information to the user through the application. This class helps you to provide method and property for creating notification object.
See Also
View SourceProperty
Gets or sets property.
Declaration
public NotificationProperty Property { get; set; }
Property Value
Type | Description |
---|---|
NotificationProperty |
Remarks
A notification is a message that is displayed on the notification area. It is created to notify information to the user through the application. This class helps you to provide method and property for creating notification object.
See Also
View SourceSubIcon
Gets or sets the sub icon of notification. This SubIcon is displayed in Icon you set. You should set an absolute path for an image file.
Declaration
public string SubIcon { get; set; }
Property Value
Type | Description |
---|---|
string |
Remarks
A notification is a message that is displayed on the notification area. It is created to notify information to the user through the application. This class helps you to provide method and property for creating notification object.
Tag
Gets or sets the tag of notification.
Declaration
public string Tag { get; set; }
Property Value
Type | Description |
---|---|
string |
Remarks
A notification is a message that is displayed on the notification area. It is created to notify information to the user through the application. This class helps you to provide method and property for creating notification object.
TimeStamp
Gets or sets the TimeStamp of notification.
Declaration
public DateTime TimeStamp { get; set; }
Property Value
Type | Description |
---|---|
System.DateTime |
Remarks
If you don't set TimeStamp, it will set the value when the notification is posted. TimeStamp requires NotificationManager.Post() to be called. If you set IsVisibleTimeStamp property to false, TimeStamp is not visible in notification.
Title
Gets or sets the title of notification.
Declaration
public string Title { get; set; }
Property Value
Type | Description |
---|---|
string |
Remarks
A notification is a message that is displayed on the notification area. It is created to notify information to the user through the application. This class helps you to provide method and property for creating notification object.
Methods
View SourceAddStyle(StyleBase)
Method for adding various styles to be applied to notification.
Declaration
public void AddStyle(Notification.StyleBase style)
Parameters
Type | Name | Description |
---|---|---|
Notification.StyleBase | style | The style to be applied to notification. |
Remarks
The user always see about valid notification style. If you add a style which is not supported in platform, this method has no effect.
Examples
Notification notification = new Notification
{
Title = "Notification",
Content = "Hello Tizen",
Icon = "Icon path",
Count = 3
};
Notification.LockStyle lockStyle = new Notification.LockStyle
{
IconPath = "Icon path",
ThumbnailPath = "Thumbnail Path"
};
notification.AddStyle(lockStyle);
NotificationManager.Post(notification);
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when argument is invalid. |
Dispose()
Releases any unmanaged resources used by this object.
Declaration
public void Dispose()
Remarks
A notification is a message that is displayed on the notification area. It is created to notify information to the user through the application. This class helps you to provide method and property for creating notification object.
GetExtraData(string)
Method to get extra data you already set.
Declaration
public Bundle GetExtraData(string key)
Parameters
Type | Name | Description |
---|---|---|
string | key | The key of the extra data to get. |
Returns
Type | Description |
---|---|
Bundle | Bundle Object that include extra data |
Remarks
A notification is a message that is displayed on the notification area. It is created to notify information to the user through the application. This class helps you to provide method and property for creating notification object.
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when argument is invalid. |
GetStyle<T>()
Method to get style you already added.
Declaration
public T GetStyle<T>() where T : Notification.StyleBase, new()
Returns
Type | Description |
---|---|
T | The Notification.Style object associated with the given style. |
Type Parameters
Name | Description |
---|---|
T | Type of notification style to be queried. |
Remarks
A notification is a message that is displayed on the notification area. It is created to notify information to the user through the application. This class helps you to provide method and property for creating notification object.
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when argument is invalid. |
RemoveExtraData(string)
Method to remove extra you already added.
Declaration
public void RemoveExtraData(string key)
Parameters
Type | Name | Description |
---|---|---|
string | key | The key of the extra data to add. |
Remarks
The type of extra data is bundle.
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when argument is invalid. |
RemoveStyle<T>()
Method to remove style you already added.
Declaration
public void RemoveStyle<T>() where T : Notification.StyleBase, new()
Type Parameters
Name | Description |
---|---|
T | Type of notification style to be queried. |
Remarks
A notification is a message that is displayed on the notification area. It is created to notify information to the user through the application. This class helps you to provide method and property for creating notification object.
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when argument is invalid. |
SetExtraData(string, Bundle)
Method to set extra data to add extra data.
Declaration
public void SetExtraData(string key, Bundle value)
Parameters
Type | Name | Description |
---|---|---|
string | key | The key of the extra data you want to add. |
Bundle | value | The value you want to add. |
Remarks
The type of extra data is bundle.
Examples
Notification notification = new Notification
{
Title = "Notification",
Content = "Hello Tizen",
Icon = "Icon path",
};
Bundle bundle = new Bundle();
bundle.AddItem("key", "value");
notification.SetExtraData("firstKey", bundle);
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when argument is invalid. |