在全景页面中设置用户控制的全景背景

发布于 2024-10-12 23:39:31 字数 1580 浏览 4 评论 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>

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

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

How set the Panorama page Background for User control which is inside the PanoramaItem ?

I had put one user control in Panorama Item. I expect that the same panoroma background is applied to user control, but its not, there is a difference..? how to set the normal Panorama Back ground to the user control which is bound to the panorama item.

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

While I am running the application I can see the difference in Back ground of user control. I need the same feel as Panorama not the user control. for that I need the back ground of user control is same as Panorama. - while applying light theam to phone.

I need a transparent background of user control.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

悍妇囚夫 2024-10-19 23:39:31

我怀疑您的一个(或多个)用户控件在根元素上设置了背景值。在 Visual Studio 中添加的默认 UserControl 在根网格(名为 LayoutRoot)上设置了 Background 属性:Background="{StaticResource PhoneChromeBrush}",该属性不透明。如果您只是删除Background 属性,UserControl 将变得透明:

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文