0

如何为 PanoramaItem 内的用户控件设置全景页面背景?

我在全景项目中放置了一个用户控件。我希望将相同的全景背景应用于用户控件,但事实并非如此,有区别..?如何为绑定到全景项目的用户控件设置正常的全景背景。

<controls:Panorama Grid.Row="1">

            <!--Panorama item one-->
            <controls:PanoramaItem Header="{Binding Path= Localizedresources.RecentPanoramaItemHeader, Source={StaticResource LocalizedResources}}">
                <views:RecentFileView DataContext="{Binding RecentFileViewModel}" />
            </controls:PanoramaItem>

            <!--Panorama item two-->
            <controls:PanoramaItem Header="{Binding Path= Localizedresources.FileserversPanoramaItemHeader, Source={StaticResource LocalizedResources}}">
                <views:DashboardView DataContext="{Binding DashboardViewModel}"  />
            </controls:PanoramaItem>

            <!--Panorama item three-->
            <controls:PanoramaItem Header="{Binding Path= Localizedresources.MenuPanoramaItemHeader, Source={StaticResource LocalizedResources}}">
                <Grid>

                </Grid>
            </controls:PanoramaItem>

            <!--Panorama item four-->
            <controls:PanoramaItem Header="{Binding Path= Localizedresources.TheftguardPanoramaItemHeader, Source={StaticResource LocalizedResources}}">
                <Grid/>
           </controls:PanoramaItem>
        </controls:Panorama>

当我运行应用程序时,我可以看到用户控制背景的差异。我需要与全景而不是用户控件相同的感觉。为此,我需要用户控制的背景与全景图相同。- 将轻量级应用到手机时。

我需要一个透明的用户控件背景。

4

1 回答 1

1

I suspect that one (or more) of your UserControls has a Background value set on the root element. The default UserControl that gets added in Visual Studio has the Background property on the root Grid (named LayoutRoot) set: Background="{StaticResource PhoneChromeBrush}", which is not transparent. If you simply remove the Background property, the UserControl will become transparent: <Grid x:Name="LayoutRoot">.

于 2011-01-20T12:24:19.773 回答