简体   繁体   English

XAML WPF如何拉伸框架以填充窗口

[英]XAML WPF how to stretch the frame to fill the window

The title it's quite descriptive. 标题非常具有描述性。 I have the frame of a page which I want to stretch to fill the window. 我有一个页面框架,我想拉伸以填充窗口。 I'd be thankful if someone could give me a heads up on what I should be doing. 如果有人可以给我提起我应该做的事情,我将不胜感激。 Here is my XAML code: 这是我的XAML代码:

<Page x:Class="testWPF.CameraPage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      xmlns:controls="clr-namespace:LightBuzz.Vitruvius.Controls;assembly=LightBuzz.Vitruvius"
      mc:Ignorable="d" 
      Height="1920" Width="1080"
      d:DesignHeight="1920" d:DesignWidth="1080"
      Title="Camera"
      Unloaded="Page_Unloaded">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <controls:KinectViewer HorizontalAlignment="Stretch" x:Name="viewer" VerticalAlignment="Stretch" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"/>
        <Frame HorizontalAlignment="Stretch" VerticalAlignment="Stretch" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Name="frame2" NavigationUIVisibility="Hidden"/>
    </Grid>
</Page>

Grid.RowSpan="2"添加到Frame

<Frame Grid.RowSpan="2" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Name="frame2" NavigationUIVisibility="Hidden"/>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM