我正在使用 Caliburn Micro 开发 Windows Store App。
在我拥有的ContentControl
其中一个页面中,显示UserControl
. 在UserControl
我有GridView
.
我的问题是:如何设置UserControl.Width
相同ContentControl.Width
?
注意: whit set UserControl.Width=Auto
- 宽度与GridView.Width
在 page.xaml
<ContentControl x:Name="ActiveItem" />
在 usercontrol.xaml
<UserControl
x:Class="Test.Views.GroupView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" Width="Auto" Height="Auto">
<Grid Margin="0,20">
<GridView x:Name="Groups" Margin="0" />
</Grid>
</UserControl>
更新
添加
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"
到UserControl
并不能解决问题。