8,735
社区成员
发帖
与我相关
我的任务
分享
public Shell()
{
InitializeComponent();
this.SizeChanged += new SizeChangedEventHandler(Shell_SizeChanged);
}
private void Shell_SizeChanged(object sender, SizeChangedEventArgs e)
{
if (this.Parent is FrameworkElement)
{
var parent = this.Parent as FrameworkElement;
if (parent == null) return;
this.Height = parent.ActualHeight;
this.Width = parent.ActualWidth;
}
}