Пример #1
0
        private void Notify(MessageModel message)
        {
            if (!_mainWindow.IsActive)
            {
                notifier.ShowNotification(message.ToChatName, message.Name, message.Color, message.PhotoPath, GetContent(message));
            }

            FlashWindowHelper.FlashWindow(_mainWindow);
            player.Play();
        }
        public NotificationWindow(string symbol, string condition)
        {
            InitializeComponent();

            Dispatcher.BeginInvoke(DispatcherPriority.ApplicationIdle, new Action(() =>
            {
                var workingArea = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea;
                var transform   = PresentationSource.FromVisual(this).CompositionTarget.TransformFromDevice;
                var corner      = transform.Transform(new Point(workingArea.Right, workingArea.Bottom));

                this.Left = corner.X - this.ActualWidth - 100;
                this.Top  = corner.Y - this.ActualHeight;
            }));

            Title.Text = symbol;
            Body.Text  = condition;

            FlashWindowHelper.FlashWindow(this);
        }