public void AddNotification(NotificationItem notification) { NotificationVisualContainer visualContainer = new NotificationVisualContainer(); visualContainer.Background = Brushes.Gray; visualContainer.Notification = notification; visualContainer.Width = 350; visualContainer.Height = 100; VisualContainers.Add(visualContainer); //VisualContainers.Remove(visualContainer); Timer.RegisterNewAction(1500, () => VisualContainers.Remove(visualContainer)); }
public void Show(NotificationItem notification) { if (viewModel == null) { var workArea = SystemParameters.WorkArea; var viewModel = new NotificationWindowViewModel(); NotificationWindow window = new NotificationWindow(); window.DataContext = viewModel; window.Left = workArea.Left; window.Top = workArea.Top; window.Width = workArea.Width; window.Height = workArea.Height; window.Show(); this.viewModel = viewModel; } this.viewModel.AddNotification(notification); }