0
我想用下面的代码Application.current.mainwindow childwindow替代
Point point1 = pwImages.ElementAt(0).TransformToAncestor(Application.Current.MainWindow).Transform(new Point(0, 0));
然而,Application.Current.MainWindow未设置为调用此代码的窗口,因为主窗口是称为窗口App.xaml中。除了Application.Current.MainWindow还有我可以使用的替代方法吗?或者我可以将Application.Current.MainWindow重置为当前窗口吗?