1

私のWP7アプリには、2 つのページpage1page2. ユーザーが に移動したときpage2に、ページを透明にして、page1がバックグラウンドで見えるようにします。で次のコードを使用していますがpage2、この効果が得られません。

<phone:PhoneApplicationPage 
x:Class="BoxIt.Page3"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Portrait" Orientation="Portrait"
mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480"
shell:SystemTray.IsVisible="True"
 Opacity="0">

<!--LayoutRoot is the root grid where all page content is placed-->
<Grid x:Name="LayoutRoot" Opacity="0" Background="Transparent">


    <!--ContentPanel - place additional content here-->
    <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
        <Canvas HorizontalAlignment="Center" VerticalAlignment="Center" Width="400" Height="400">
            <TextBlock FontSize="30"  FontFamily="{StaticResource PoloBrush}" Canvas.Left="24" Canvas.Top="53" Height="30" Name="tb1" Text="" />
            <TextBlock FontSize="30" FontFamily="{StaticResource PoloBrush}" Canvas.Left="24" Canvas.Top="147" Height="30" Name="tb2" Text="" />
            <Button  ManipulationStarted="button1_ManipulationStarted" FontFamily="{StaticResource PoloBrush}" Canvas.Left="24" Canvas.Top="267" Content="Play again" Height="72" Name="button1" Width="179" />
            <Button  ManipulationStarted="button2_ManipulationStarted" FontFamily="{StaticResource PoloBrush}" Canvas.Left="209" Canvas.Top="267" Content="Menu" Height="72" Name="button2" Width="160" />
        </Canvas>
    </Grid>
</Grid>

4

1 に答える 1

2

そんなことはできません。ナビゲーションを実行すると -Page 1非表示になり、ページ 2 が表示されます。そのため、最初のページは表示されません。

ページ 1 に対して透過的なコントロールを示すことができます (yogesh が言ったように)。

または、ページ 1 をビットマップにレンダリングして、ページ 2 の背景として使用することもできます。

しかし、これはメトロスタイルではないと思います。私は他のUI決定を使用します。

于 2012-10-06T11:38:39.167 に答える