using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Timers; using System.Windows.Media; using Tango.Core; namespace Tango.PPC.Common.Notifications { /// /// Represents a base notification item. /// public abstract class NotificationItem : ItemBase { public enum NotificationPriority { Low, Normal, High, VeryHigh, Critical, } /// /// Initializes a new instance of the class. /// public NotificationItem() : base() { CanClose = true; Priority = NotificationPriority.Normal; } /// /// Gets or sets the notification date and time. /// public DateTime Time { get; set; } private bool _canClose; /// /// Gets or sets a value indicating whether this instance can close. /// public bool CanClose { get { return _canClose; } set { _canClose = value; RaisePropertyChangedAuto(); } } /// /// Gets or sets the notification priority. /// public NotificationPriority Priority { get; set; } /// /// Called when the item has been pressed. /// protected override void OnPreesed() { base.OnPreesed(); if (CanClose) { Close(); } } } }