0
ポップアップを画面中央に正確に配置したいと考えています。 私はUserControlを使用してポップアップ内に表示しています。 しかし、HorizontalOffsetと垂直オフセットを計算する方法は間違っています。ポップアップ/ UserControlを中心に
Popup popUp = new Popup();
ProgressScreen progressScreen = new ProgressScreen();
popUp.Child = progressScreen;
//popUp.HorizontalOffset = (this.ActualWidth/2) + (progressScreen.ActualWidth/2);
popUp.VerticalOffset = (this.ActualHeight/2) + (progressScreen.ActualHeight/2);
popUp.HorizontalOffset = (this.ActualWidth - progressScreen.ActualWidth)/2;
popUp.Height = this.ActualHeight;
popUp.Width = this.ActualWidth;
popUp.IsOpen = true;