Windows phone 7 WP7中的透明页面

Windows phone 7 WP7中的透明页面,windows-phone-7,xaml,Windows Phone 7,Xaml,在我的WP7应用程序中,我有两个页面,page1和page2。当用户导航到page2时,我希望页面是透明的,这样就可以在后台看到page1。我在page2中使用了以下代码,但没有得到这种效果 <phone:PhoneApplicationPage x:Class="BoxIt.Page3" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.

在我的
WP7
应用程序中,我有两个页面,
page1
page2
。当用户导航到
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>


你不能那样做。执行导航时-
第1页
隐藏,第2页显示。所以,你看不到第一页

你可以在你的页面1上显示一些透明的控制(正如yogesh所说)

或者,您可以将第1页渲染为位图,并将其用作第2页的背景


但我认为这不是地铁风格。我会使用其他UI决策。

Hi Ashini,我也试过一次,但没有成功,所以我没有创建透明页面,而是在同一个页面中创建了透明网格page@yogesh用户可以触摸这个透明网格后面的元素吗?不能触摸。为了提高你的视觉效果,还可以使用transparent图像(带有一些光泽)作为网格的背景。使用可见性和collasped函数来显示和隐藏网格(而不是导航)。哦,太遗憾了,这在android中是可能的,一个透明的活动胜过另一个。是的,我知道android。你最好不要在WindowsPhone7上重复Android或iOs用户界面。