使用以下XAML时,窗口大小不是5000x5000,而是一些裁剪按钮的小窗口。未指定SizeToContent时的窗口大小
<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>
从我可以告诉,大小没指定SizeToContent属性,默认为“手动”,所以它会使用*size of a window is determined by other properties, including Width, Height, MaxWidth, MaxHeight, MinWidth, and MinHeight. *从WPF Windows Overview,似乎与其他属性是FrameworkElement的::了minHeight /宽,和FrameworkElement :: MaxHeight。但是因为Mins的默认值是0,Maxs是无穷大,宽度/高度是Nan ....发生了什么事? WPF在哪里获得窗口大小?
任何指向正确的方向将不胜感激。
不是一个真正的答案。这是如何定义“手动”设置(当手动调整大小时的窗口大小)。问题在于它是从哪里获得的。 – moogs 2009-09-25 07:09:47
记事本正在写入并将其位置写入注册表:[HKEY_CURRENT_USER \ Software \ Microsoft \ Notepad]这是包括第三方在内的大多数应用程序的最佳实践。 – bitbonk 2009-10-01 09:34:30