Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 410105
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T17:51:21+00:00 2026-05-12T17:51:21+00:00

I have an issue when attempting to set the background of a grid in

  • 0

I have an issue when attempting to set the background of a grid in a Silverlight 3 app to a gradient. When I set the background of a grid in my application to a gradient, that gradient simply does not render in the browser. I have set this gradient brush as a resouce (both in app.xaml as well as in the local XAML file) and I have also tried hard coding the gradient brush directly. I have made the changes manually in the XAML from VS and in Expression Blend.

When the chane is made and the file is viewed in Blend, the background color renders correctly. When the background is set to a solid color (both hard coded and as a resource) the background renders just fine both in Expression and in the browser. Both of these things suggest to me that this isn’t a z-index issue with one control rendering on top of the control in question.

The XAML for the brush is:

<LinearGradientBrush x:Key="TestBrush"
         EndPoint="0.5,1"
         StartPoint="0.5,0">
    <GradientStop Color="#8DFFFFFF"
            Offset="1" />
    <GradientStop Color="#E4FFFFFF" />
</LinearGradientBrush>

The XAML for the grid and it’s contents is:

<Grid Margin="1,0,0,0"
    Grid.Row="0"
    VerticalAlignment="Top"
    Height="49" Background="{StaticResource TestBrush}">
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="2*" />
        <ColumnDefinition Width="*" />
    </Grid.ColumnDefinitions>
    <Grid.RowDefinitions>
        <RowDefinition Height="*" />
        <RowDefinition Height="*" />
    </Grid.RowDefinitions>
    <StackPanel Orientation="Horizontal"
            Margin="0"
            Grid.Column="0"
            Grid.Row="0">
        <TextBlock Margin="0.125,1.5,1,1.5"
             VerticalAlignment="Center">Code:</TextBlock>
        <TextBox x:Name="SearchCodeTextBox"
             Padding="1,0,0,0"
             Margin="1,1.5,0,1.5"
             Width="44"
             Text="{Binding Mode=TwoWay, Path=CurrentTabularViewModel.SearchCode}"
             TextWrapping="Wrap"
             KeyUp="SearchCodeTextBox_KeyUp" />
        <StackPanel Margin="2,0"                                        
            Height="20" 
            Background="{StaticResource CP_Blue2}">
            <TextBlock MinWidth="200" />
        </StackPanel>
        <Button Margin="10,1,0,1"
            Content="Add Code"
            Height="20" />
    </StackPanel>
    <StackPanel Orientation="Horizontal"
            Margin="35,0,0,0"
            Grid.Row="1"
            Grid.Column="0">
        <Button Margin="0"
            Width="24"
            Content="<"
            Height="20"
            VerticalContentAlignment="Top" />
        <Button Margin="2,0"
            Content="Tabular"
            Height="20"
            Width="Auto"
            HorizontalAlignment="Stretch"
            commands:Click.Command="{Binding Path=CurrentTabularViewModel.SearchCommand}"
            commands:Click.CommandParameter="{Binding Path=SelectedSessionType}" />
        <Button Content=">"
            Width="24"
            Margin="2,0"
            Height="20" />
        <Button Content="Instructional Notes"
            Width="Auto"
            Margin="30,0,2,0"
            Height="20" />
    </StackPanel>
</Grid>

Any thoughts?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T17:51:22+00:00Added an answer on May 12, 2026 at 5:51 pm

    OK, so here’s the deal. It’s not a bug, at least not on Silverlight’s part! It’s a bug on the part of the developer!

    If you look closer at the gradient used in the resource, only the first two hex values change (see below). This is, of course, the Alpha channel, along with all Fs following that, I’m really just going from one level of transparency to another.

    <LinearGradientBrush x:Key="TestBrush"
             EndPoint="0.5,1"
             StartPoint="0.5,0">
        <GradientStop Color="#8DFFFFFF"
                    Offset="1" />
        <GradientStop Color="#E4FFFFFF" />
    </LinearGradientBrush>
    

    Now, becuase this is a component that’s being injected into a larger page, the background is set by the larger page. So in Blend, the background is BLEND’s background, which is a gray color, which makes the whole thing look like it has a gray gradient in Blend, but it’s simply white with various levels of transparency. When the control is injected into the main page which has a white background, you can’t see it.

    So, what’s moral of this story? Pay attention to the color you’re working with!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have issue that is reproduced on g++. VC++ doesn't meet any problems. So
I have an issue which I could not find answer for across the web.
I have a gridview that I am attempting to update the row. If I
I am attempting to render a UI using Sproutcore where I have a list
I have run into an issue when attempting to globalCompositeOperation to mask/blend shapes and
I have a simple ncurses program set up that reads characters one at a
I have an issue similar to the following post: Silverlight DataGridTextColumn Binding Visibility I
I am having an issue attempting to set the height of a div with
I have an MVC3 View that's posting back a set of input values via
I have a search field in my app and I have set the return

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.