using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; namespace VisionCommon { public class WindowUtil { public static double GetLeftWithRatioOnMainWindow(double ratio) { return GetLeftWithRatio(Application.Current.MainWindow, ratio); } public static double GetLeftWithRatio(Window window, double ratio) { return window.Left + (window.Width * ratio); } public static double GetTopWithRatioOnMainWindow(double ratio) { return GetTopWithRatio(Application.Current.MainWindow, ratio); } public static double GetTopWithRatio(Window window, double ratio) { return window.Top + (window.Height * ratio); } } }