在全景页面中设置用户控制的全景背景
如何为 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我怀疑您的一个(或多个)用户控件在根元素上设置了背景值。在 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">
.