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; } }
public EntryBundle Add(Key key, NotificationLocation location, params object[] args) { var entry = new Notification(key, location, args); Entries.Add(entry); return(this); }
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); }
internal ToastsManager(ManualResetEventSlim reset, NotificationLocation location = NotificationLocation.BottonRight) : this(location) { reset.Set(); }
public ToastsManager(NotificationLocation location = NotificationLocation.BottonRight) { InitializeComponent(); NotificationsControl.DataContext = ToastsCollection; SetNotificationsLocation(location); }
/// <summary> /// Change the location of the notiflication /// </summary> /// <param name="location"></param> public static void SetNotificationLocation(NotificationLocation location) { Manager.SetNotificationsLocation(location); }