【发布时间】:2009-09-17 06:47:57
【问题描述】:
当使用下面的 XAML 时,窗口大小不是 5000x5000,而是一些按钮被裁剪的小窗口。
<Window x:Class="WpfApplication1.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" >
<Button Width="5000" Height="5000">XXX</Button>
</Window>
据我所知,size 我没有指定 SizeToContent 属性,默认是“Manual”,所以它会使用*size of a window is determined by other properties, including Width, Height, MaxWidth, MaxHeight, MinWidth, and MinHeight. * 从WPF Windows Overview,似乎那些其他属性是 FrameworkElement::MinHeight/Width , 和 FrameworkElement::MaxHeight。但是由于 Mins 的默认值为 0,Maxs 为 Infinity,而 Width/Height 为 Nan ....这是怎么回事? WPF 从哪里获取窗口大小?
任何指向正确方向的指针将不胜感激。
【问题讨论】: