我有一个旧的Windows窗体应用程序与通知窗口像工具提示,我正在更新wpf ..

我试图转换Windows窗体代码

this.Location = new Point(this.Location.X, this.Location.Y - 3);
if (this.Location.Y < Screen.PrimaryScreen.Bounds.Height - 190) {
    Timer1.Stop();
    Timer2.Start();
}

这是我在Wpf中尝试过的

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;
                this.Top = corner.Y;



                if (this.Top < Screen.PrimaryScreen.Bounds.Height - 190) {

                    _timer1.Stop();
                    _timer2.Start();
                }

我是新的Wpf和即时学习..感谢您的帮助 .