title: Canvas Background color not showing
body: <p>I created a <code>UserControl</code> to display a popup using a <code>TextBlock</code> within a <code>Canvas</code>. Everything seems to be working OK, except for the background color of the canvas. It is being rendered as transparent no matter what I try. I also tried adding a <code>Rectangle</code> and filling it but that isn't working either. Here's the code:</p>
  
  <pre><code>&lt;UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
               xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
               xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
               xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
               xmlns:Custom="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
               xmlns:ic="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions"
               xmlns:System="clr-namespace:System;assembly=mscorlib"
               mc:Ignorable="d"
               x:Class="PopupText.CanvasPopup"
               d:DesignWidth="456"
               d:DesignHeight="129"&gt;
  
    &lt;StackPanel x:Name="LayoutRoot"
                Orientation="Horizontal"&gt;
  
          &lt;!--This button toggles the visibility of the popup--&gt;
      &lt;Button x:Name="ActivateButton"
              HorizontalAlignment="Left"
              VerticalAlignment="Top"
              BorderThickness="0"
              Click="OnActivateButtonClicked"&gt;
  
        &lt;Image Source="/pushpin.png"
               Width="36"
               Height="36"
               HorizontalAlignment="Center"
               VerticalAlignment="Center"
               Stretch="Fill"
               Margin="0" /&gt;
  
      &lt;/Button&gt;
  
      &lt;Canvas x:Name="PopupContainer"
              HorizontalAlignment="Left"
              VerticalAlignment="Top"
              Width="{Binding Width, ElementName=PopupText}"
              Height="{Binding Height, ElementName=PopupText}"
              Visibility="Collapsed"&gt;
        &lt;Canvas.Background&gt;
          &lt;LinearGradientBrush EndPoint="0.5,1"
                               StartPoint="0.5,0"&gt;
            &lt;GradientStop Color="Black"
                          Offset="0" /&gt;
            &lt;GradientStop Color="#7FA79797"
                          Offset="1" /&gt;
          &lt;/LinearGradientBrush&gt;
        &lt;/Canvas.Background&gt;
        &lt;Rectangle Canvas.Left="0"
                   Canvas.Top="0"
                   RadiusX="20"
                   RadiusY="20"
                   Width="{Binding Width, ElementName=PopupText}"
                   Height="{Binding Height, ElementName=PopupText}"&gt;
          &lt;Rectangle.Fill&gt;
            &lt;LinearGradientBrush EndPoint="0.5,1"
                                 StartPoint="0.5,0"&gt;
              &lt;GradientStop Color="Black"
                            Offset="0" /&gt;
              &lt;GradientStop Color="#7F67749D"
                            Offset="1" /&gt;
            &lt;/LinearGradientBrush&gt;
          &lt;/Rectangle.Fill&gt;
          &lt;Rectangle.Stroke&gt;
            &lt;LinearGradientBrush EndPoint="0.5,1"
                                 StartPoint="0.5,0"&gt;
              &lt;GradientStop Color="Black"
                            Offset="0" /&gt;
              &lt;GradientStop Color="#7FC89B9B"
                            Offset="1" /&gt;
            &lt;/LinearGradientBrush&gt;
          &lt;/Rectangle.Stroke&gt;
        &lt;/Rectangle&gt;
        &lt;TextBlock x:Name="PopupText"
                   Text="A really long line of text that will either overflow or wrap"
                   TextWrapping="Wrap"
                   Width="350"
                   Canvas.Left="0"
                   Canvas.Top="0" /&gt;
      &lt;/Canvas&gt;
    &lt;/StackPanel&gt;
  &lt;/UserControl&gt;
  </code></pre>
  
  <p>Thanks for your help!</p>