Page Layout in a silverlight Prism project
OK, I've tried asking this question here, but with not much success. Tried a few hacks like this one; Correct me if I am wrong but I don't think that is the best way.
What I am trying to do is get the silverlight application to span the entire browser area. The solution provided in my previous question works for a standard silverlight project, but for a silverlight Prism project somehow the same rules don't seem to apply. I think that has something to do with the silverlight module containing the page which has the main user control loading within the Content control of the Shell.xaml.
Does anyone know how to fix this?
The code of my Shell.xaml below:
<UserControl x:Class="MyNamspace.Shell"
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"
xmlns:Regions="http://www.codeplex.com/prism"
Background="#FF2D8543"
>
<ContentControl Regions:RegionManager.RegionName="MainRegion"
Background="Black"
VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch"
>
</ContentControl>
The xaml of my Modulepage which I register within the Contentcontrol of the Shell.xaml
<UserControl x:Class="MyNamspace.MyClass"
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"
xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
MinHeight="800" MinWidth="800"
>
<UserControl.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="Black" Offset="0"/>
<GradientStop Color="#FF2D8543" Offset="1"/>
</LinearGradientBrush>
</UserControl.Background>
<Grid x:Name="LayoutRoot" Background="#FFEB0A0A"
VerticalAlignment="Top" HorizontalAlignment="Center"
>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<开发者_JAVA百科;/Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<sdk:Label Height="23" HorizontalAlignment="Left" Margin="64,85,0,0" Name="label1"
VerticalAlignment="Top" Width="252" Content="Login page here" />
</Grid>
The reason I am using different colors is because I want to see where the Shell's usercontrol is and where within it is the Contentcontrol. Same goes for my module's page.
Thanks again...
Remove VerticalAlignment
and HorizontalAlignment
assignments from LayoutRoot
.
精彩评论