【发布时间】:2014-01-03 07:14:08
【问题描述】:
我有一个窗口,里面有一个 tabcontrol,每个 tabitem 都有一个框架,它绑定到一个页面对象。但我似乎无法调整框架/页面大小以适应“主窗口”。这是我的代码:
<controls:MetroWindow x:Class="Mplayer.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
Title="Mplayer"
Initialized="Window_Initialized" Height="770" Width="1125">
<TabControl HorizontalAlignment="Left" Height="45" VerticalAlignment="Top" Width="1125" Margin="0,0,0,0">
<TabItem Header="Home" x:Name="HomeTab">
<TabItem.Content>
<Frame Source="HomePage.xaml" Margin="0,0,7,-697"/>
</TabItem.Content>
</TabItem>
</TabControl>
</controls:MetroWindow>
这里是“HomePage.xaml”
<Page x:Class="Mplayer.HomePage"
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"
mc:Ignorable="d"
Height="770" Width="1125"
Title="HomePage" Foreground="Black">
<Grid Background="#373737">
<Grid Background="#585858" HorizontalAlignment="Left" Width="400"/>
</Grid>
</Page>
希望您能理解我的问题,并在此先感谢:)
【问题讨论】: