コード例 #1
0
        private void Image_MouseDown(object sender, MouseButtonEventArgs e)
        {
            var trayIcon = (sender as Decorator).DataContext as NotifyIcon;

            // set current menu bar to return placement for ABM_GETTASKBARPOS message
            Host?.SetTrayHostSizeData();

            trayIcon?.IconMouseDown(e.ChangedButton, MouseHelper.GetCursorPositionParam(), System.Windows.Forms.SystemInformation.DoubleClickTime);
        }
コード例 #2
0
        private void Image_MouseEnter(object sender, MouseEventArgs e)
        {
            Decorator sendingDecorator = sender as Decorator;
            var       trayIcon         = sendingDecorator.DataContext as NotifyIcon;

            if (trayIcon != null)
            {
                // update icon position for Shell_NotifyIconGetRect
                Point  location = sendingDecorator.PointToScreen(new Point(0, 0));
                double dpiScale = PresentationSource.FromVisual(this).CompositionTarget.TransformToDevice.M11;

                trayIcon.Placement = new NativeMethods.Rect {
                    Top = (int)location.Y, Left = (int)location.X, Bottom = (int)(sendingDecorator.ActualHeight * dpiScale), Right = (int)(sendingDecorator.ActualWidth * dpiScale)
                };
                trayIcon.IconMouseEnter(MouseHelper.GetCursorPositionParam());
            }
        }
コード例 #3
0
        private void Image_MouseMove(object sender, MouseEventArgs e)
        {
            var trayIcon = (sender as Decorator).DataContext as NotifyIcon;

            trayIcon?.IconMouseMove(MouseHelper.GetCursorPositionParam());
        }
コード例 #4
0
ファイル: SystemTray.xaml.cs プロジェクト: zen0bit/cairoshell
        private void Image_MouseUp(object sender, MouseButtonEventArgs e)
        {
            var trayIcon = (sender as Decorator).DataContext as NotifyIcon;

            trayIcon?.IconMouseUp(e.ChangedButton, MouseHelper.GetCursorPositionParam(), System.Windows.Forms.SystemInformation.DoubleClickTime);
        }
コード例 #5
0
ファイル: NotifyIcon.xaml.cs プロジェクト: dremin/RetroBar
 private void NotifyIcon_OnMouseMove(object sender, MouseEventArgs e)
 {
     e.Handled = true;
     TrayIcon?.IconMouseMove(MouseHelper.GetCursorPositionParam());
 }
コード例 #6
0
ファイル: NotifyIcon.xaml.cs プロジェクト: dremin/RetroBar
 private void NotifyIcon_OnMouseUp(object sender, MouseButtonEventArgs e)
 {
     e.Handled = true;
     TrayIcon?.IconMouseUp(e.ChangedButton, MouseHelper.GetCursorPositionParam(), System.Windows.Forms.SystemInformation.DoubleClickTime);
 }