locked
Background color RRS feed

  • Question

  • hi,

    in main page i have this peace of code - <Grid Style="{StaticResource NavigationOuterGridStyle}">

    and in the style.xaml

    <!-- Navigation Outer StackPanel Style -->
        <Style x:Key="NavigationOuterGridStyle" TargetType="Grid">

    result of this is

    then when i change the code for this (to have a background color)i tried different colors too - same result

    <!-- Navigation Outer StackPanel Style -->
        <Style x:Key="NavigationOuterGridStyle" TargetType="Grid">
            <Setter Property="Background" Value="Black"/>
        </Style>

    i get this

    so the question is where all the stuff is gone, i thought i was just changing the background color, but here it looks like its puting that color on top of it, please help, thanks

    Roly


    Wednesday, May 11, 2011 7:56 PM

All replies

  • Please post a full code sample so we can attempt to reproduce the issue.

    Brice

    Wednesday, May 11, 2011 11:19 PM
  • Can you please inculde the XAML?

    Wednesday, May 11, 2011 11:25 PM
  • Did the problem occure only when setting the background color to black or it exist for the other color as well ?

    Thursday, May 12, 2011 12:23 AM
  • I think the following style is getting applied for the all the components -

    <Style x:Key="NavigationOuterGridStyle" TargetType="Grid">
    <Setter Property="Background" Value="Black"/>
    </Style>

    that is the buttons that you have are also having background color as black, due to the above style.

    You can verify this by specifying some different color for Button (may be in xaml, but specify it ONLY for button)

    Thursday, May 12, 2011 1:09 AM
  • here is more of xaml


    <Grid x:Name="LayoutRoot" Style="{StaticResource LayoutRootGridStyle}">

        <Border x:Name="ContentBorder" Style="{StaticResource ContentBorderStyle}" Margin="0,121,0,-30">
                <navigation:Frame x:Name="ContentFrame" Style="{StaticResource ContentFrameStyle}"
                                  Source="/Home" Navigated="ContentFrame_Navigated" NavigationFailed="ContentFrame_NavigationFailed">
                    <navigation:Frame.UriMapper>
                      <uriMapper:UriMapper>
                        <uriMapper:UriMapping Uri="" MappedUri="/Views/Home.xaml"/>
                        <uriMapper:UriMapping Uri="/{pageName}" MappedUri="/Views/{pageName}.xaml"/>
                      </uriMapper:UriMapper>
                    </navigation:Frame.UriMapper>
                </navigation:Frame>
        </Border>

        <Grid Style="{StaticResource NavigationOuterGridStyle}">
          <Grid x:Name="NavigationGrid" Style="{StaticResource NavigationGridStyle}" Height="116">

            <Border x:Name="BrandingBorder" Style="{StaticResource BrandingBorderStyle}" Height="82" Margin="25,0,0,0" Width="256">
              <StackPanel x:Name="BrandingStackPanel" Style="{StaticResource BrandingStackPanelStyle}" Height="81">

                <ContentControl Style="{StaticResource LogoIcon}"/>
                <TextBlock x:Name="ApplicationNameTextBlock" Style="{StaticResource ApplicationNameStyle}"
                                   Text="Testin Again"/>

              </StackPanel>
            </Border>

            <Border x:Name="LinksBorder" Style="{StaticResource LinksBorderStyle}"></Border>
                    <Border Style="{StaticResource LoginContainerStyle}" Margin="0,91,0,0" Height="25">
                        <login:LoginStatus />
                    </Border>
                    <StackPanel x:Name="LinksStackPanel" Style="{StaticResource LinksStackPanelStyle}" Height="38" Width="248" Margin="0,6,6,0" HorizontalAlignment="Right" VerticalAlignment="Top">
                        <HyperlinkButton x:Name="Home" Style="{StaticResource LinkStyle}" NavigateUri="/Home" TargetName="ContentFrame" Content="{Binding Path=Strings.HomePageTitle, Source={StaticResource ApplicationResources}}" />
                        <Rectangle x:Name="Divider1" Style="{StaticResource DividerStyle}" />
                        <HyperlinkButton x:Name="About" Style="{StaticResource LinkStyle}" NavigateUri="/About" TargetName="ContentFrame" Content="{Binding Path=Strings.AboutPageTitle, Source={StaticResource ApplicationResources}}" />
                        <Rectangle x:Name="Divider2" Style="{StaticResource DividerStyle}" />
                        <HyperlinkButton x:Name="Radio" Style="{StaticResource LinkStyle}" NavigateUri="/Radio" TargetName="ContentFrame" Content="Radio" />
                    </StackPanel>
                </Grid>
            </Grid>

      </Grid>


    -----


    it doesnt matter what color i use it gives me the same result


    Roly



    Thursday, May 12, 2011 4:51 PM
  • Your code looks good.  However, you can refer to the theme samples here for a camparison.  http://blogs.msdn.com/b/deepm/archive/2010/06/13/theme-pack-for-silverlight-business-application-released.aspx 

    Monday, May 16, 2011 5:32 AM
  • not sure what I should compare there, thanks

    Roly

    Monday, May 16, 2011 8:57 AM