xamlwindows-phonepanorama-control

Setting Panorama Background for user control in Panorama page


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.


Solution

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