window中添加 SizeChanged事件
然后:
grid1.Width = this.ActualWidth;
grid1.Height = this.ActualHeight;
var w = this.ActualWidth - 15;
var h = this.ActualHeight - 38;
textbox1.Width = w < 0 ? 0 : w;
textbox1.Height = h < 0 ? 0 : h;