2017-06-14 29 views

回答

1

您可能想要試用Viewbox的Stretch屬性。下面是我的示例:

<Viewbox Stretch="Fill"> 
     <Grid> 
      <Grid.RowDefinitions> 
       <RowDefinition/> 
       <RowDefinition/> 
       <RowDefinition/> 
      </Grid.RowDefinitions> 

      <Button Content="Button1" Grid.Row="0"/> 
      <Button Content="Button2" Grid.Row="1"/> 
      <Button Content="Button3" Grid.Row="2"/> 
     </Grid> 
    </Viewbox> 

這給:

enter image description here

雖然統一的值給出: enter image description here

如果你想有一個一致的填充你可能想包裝您的視圖框與ScrollViewer,這給了一個完整的統一填充和滾動查看器喲你可以滾動到那些你可能看不到的部分。像下面的圖片:

enter image description here

...和調整窗口的大小,使所有控件可見......

enter image description here

希望這有助於!