WPF UI页面等比例放大
在界面设计时,采用 Canvas,通过绝对定位来设计控件,而不是用Margin
<Grid>
<DockPanel LastChildFill="True">
<Menu DockPanel.Dock="Top" VerticalAlignment="Top" />
<Viewbox Stretch="Fill" >
<Canvas HorizontalAlignment="Left" Height="442" VerticalAlignment="Top" Width="794" Background="GhostWhite">
<Label Content="Button" Canvas.Left="161" Canvas.Top="117" Width="65"/>
</Canvas>
</Viewbox>
<StatusBar DockPanel.Dock="Bottom" Height="20" VerticalAlignment="Botton"/>
</DockPanel>
</Grid>