2011-05-21 40 views
0

好吧,我試過問這個問題here,但沒有太多的成功。嘗試了幾個黑客,如this一個;糾正我,如果我錯了,但我不認爲這是最好的方式。Silverlight Prism項目的頁面佈局

我想要做的是讓silverlight應用程序跨越整個瀏覽器區域。我以前的問題提供的解決方案適用於標準的Silverlight項目,但對於Silverlight Prism項目,似乎不適用相同的規則。我認爲這與包含在Shell.xaml的Content控件內加載主要用戶控件的頁面的silverlight模塊有關。

有誰知道如何解決這個問題?

我Shell.xaml下面的代碼:

<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> 

我Modulepage的,我的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="*" /> 
    </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> 

在ContentControl中內登記的XAML

我使用不同顏色的原因是因爲我想看看殼牌的u sercontrol是它的內部控件。我的模塊頁面也一樣。再次

謝謝...

回答

0

LayoutRoot刪除VerticalAlignmentHorizontalAlignment分配。