static void ShowSystemMenu(object o) { var depo = o as DependencyObject; if (depo == null) return; var win = Window.GetWindow(depo); if (win == null) return; var p = win.PointToScreen(new Point(0, GridCaptionHeight.Value)); WindowUtils.ShowSystemMenu(win, p); }
static void ShowSystemMenu(object o) { var depo = o as DependencyObject; if (depo == null) { return; } var win = Window.GetWindow(depo); if (win == null) { return; } var mwin = win as MetroWindow; Debug.Assert(mwin != null); var scale = mwin?.WpfPixelScaleFactor ?? 1; var p = win.PointToScreen(new Point(0 * scale, GridCaptionHeight.Value * scale)); WindowUtils.ShowSystemMenu(win, p); }