示例#1
0
 public void SetNotificationsLocation(NotificationLocation location) {
     if (!Dispatcher.CheckAccess()) // CheckAccess returns true if you're on the dispatcher thread
     {
         Dispatcher.Invoke(new Action(() => SetNotificationsLocation(location)));
         return;
     }
     switch (location) {
         case NotificationLocation.TopRight:
             Top = 0;
             Left = SystemParameters.PrimaryScreenWidth - Width;
             NotificationsControl.VerticalAlignment = VerticalAlignment.Top;
             break;
         case NotificationLocation.BottonRight:
             Top = SystemParameters.PrimaryScreenHeight - Height;
             Left = SystemParameters.PrimaryScreenWidth - Width;
             NotificationsControl.VerticalAlignment = VerticalAlignment.Bottom;
             break;
         case NotificationLocation.TopLeft:
             Top = 0;
             Left = 0;
             NotificationsControl.VerticalAlignment = VerticalAlignment.Top;
             break;
         case NotificationLocation.ButtomLeft:
             Top = SystemParameters.PrimaryScreenHeight - Height;
             Left = 0;
             NotificationsControl.VerticalAlignment = VerticalAlignment.Bottom;
             break;
         default:
             throw new ArgumentOutOfRangeException(nameof(location), location, null);
     }
 }
 public void Set(SetDisplayPreferenceOptions other)
 {
     if (other != null)
     {
         m_ApiVersion         = UIInterface.SetdisplaypreferenceApiLatest;
         NotificationLocation = other.NotificationLocation;
     }
 }
示例#3
0
        public EntryBundle Add(Key key, NotificationLocation location, params object[] args)
        {
            var entry = new Notification(key, location, args);

            Entries.Add(entry);

            return(this);
        }
示例#4
0
        public EntryBundle Add(IRole role, Enum entry, NotificationLocation location, params object[] args)
        {
            var key          = new Key(role, entry);
            var notification = new Notification(key, location, args);

            Entries.Add(notification);

            return(this);
        }
示例#5
0
        public void SetNotificationsLocation(NotificationLocation location)
        {
            if (!Dispatcher.CheckAccess())   // CheckAccess returns true if you're on the dispatcher thread
            {
                Dispatcher.Invoke(new Action(() => SetNotificationsLocation(location)));
                return;
            }
            switch (location)
            {
            case NotificationLocation.TopRight:
                Top  = 0;
                Left = SystemParameters.PrimaryScreenWidth - Width;
                NotificationsControl.VerticalAlignment = VerticalAlignment.Top;
                break;

            case NotificationLocation.BottonRight:
                Top  = SystemParameters.PrimaryScreenHeight - Height;
                Left = SystemParameters.PrimaryScreenWidth - Width;
                NotificationsControl.VerticalAlignment = VerticalAlignment.Bottom;
                break;

            case NotificationLocation.TopLeft:
                Top  = 0;
                Left = 0;
                NotificationsControl.VerticalAlignment = VerticalAlignment.Top;
                break;

            case NotificationLocation.ButtomLeft:
                Top  = SystemParameters.PrimaryScreenHeight - Height;
                Left = 0;
                NotificationsControl.VerticalAlignment = VerticalAlignment.Bottom;
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(location), location, null);
            }
        }
示例#6
0
 internal ToastsManager(ManualResetEventSlim reset, NotificationLocation location = NotificationLocation.BottonRight) : this(location) {
     reset.Set();
 }
示例#7
0
        public ToastsManager(NotificationLocation location = NotificationLocation.BottonRight) {
            InitializeComponent();
            NotificationsControl.DataContext = ToastsCollection;
            SetNotificationsLocation(location);

        }
示例#8
0
文件: Toaster.cs 项目: Nucs/nlib
 /// <summary>
 ///     Change the location of the notiflication
 /// </summary>
 /// <param name="location"></param>
 public static void SetNotificationLocation(NotificationLocation location) {
     Manager.SetNotificationsLocation(location);
 }
示例#9
0
 internal ToastsManager(ManualResetEventSlim reset, NotificationLocation location = NotificationLocation.BottonRight) : this(location) {
     reset.Set();
 }
示例#10
0
 public ToastsManager(NotificationLocation location = NotificationLocation.BottonRight)
 {
     InitializeComponent();
     NotificationsControl.DataContext = ToastsCollection;
     SetNotificationsLocation(location);
 }
示例#11
0
 /// <summary>
 ///     Change the location of the notiflication
 /// </summary>
 /// <param name="location"></param>
 public static void SetNotificationLocation(NotificationLocation location)
 {
     Manager.SetNotificationsLocation(location);
 }