+2  A: 

Your problem is that text is not a vector and so cannot be combined with the line (any way that I know of).

I believe that it is possible to change text into a vector path in Expression Blend and then use that to create a clipping path over the gradient. Or, using the text vector path like you would do with your line, use a background colour unrestricted-height border and transparent fill on the vector itself.

Seems like a lot of trouble to go to. Have you thought about using a third colour to merge the two? For example text block fade from Blue to Orange, then on the line Orange to the background colour. You might be able to get a similar effect for a lot less effort.

Martin
+2  A: 

In WPF you can use a Visual Brush.

Add a brush resource to your window or control resources:

<Window.Resources>   
  <VisualBrush x:Key="stackPanel">
    <VisualBrush.Visual>
      <StackPanel Orientation="Horizontal">  
        <TextBlock VerticalAlignment="Bottom"> 
          SomeTextContent        
        </TextBlock>   
        <Line VerticalAlignment="Bottom" X2="100" Stroke="black"/>     
      </StackPanel>
    </VisualBrush.Visual>
  </VisualBrush>
</Window.Resources>

Next, apply that brush to the opacitymask of a rectange, for example:

  <Rectangle OpacityMask="{DynamicResource stackPanel}">
    <Rectangle.Fill>
      <LinearGradientBrush EndPoint="1.0,0.5" StartPoint="0,0.5">
        <GradientStop Color="Blue" Offset="0"/>
        <GradientStop Color="Orange" Offset="1"/>
      </LinearGradientBrush>
     </Rectangle.Fill>
  </Rectangle>

You can turn the text into a path too, but you'll loose the ability to change the text than.

Sorskoot