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); }
protected override void OnSourceInitialized(EventArgs e) { base.OnSourceInitialized(e); WindowUtils.UpdateWin32Style(this); }