+3  A: 

Well, I do not know if that is applicable to your scenario but you could simply rotate the horizontal line using LayoutTransform and the gradient will be okay.

<Line   HorizontalAlignment="Stretch" VerticalAlignment="Center"
    Stretch="Uniform" StrokeThickness="5" X1="0" Y1="0" X2="1" Y2="0">
<Shape.Stroke>
    <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
        <GradientStop Color="Transparent" Offset="0" />
        <GradientStop Color="Green" Offset="0.5" />
        <GradientStop Color="Transparent" Offset="1" />
    </LinearGradientBrush>
</Shape.Stroke>
    <Line.LayoutTransform>
        <RotateTransform Angle="40"/>
    </Line.LayoutTransform>

Milan Nankov
Hmm, this is an acceptable workaround... I'd prefer not to, because this solution has the potential to mess up my mathematical coordinate system - but that seems like a pretty small price to pay in the end if the result is OK. I should add that I'm using RenderTransform, instead of LayoutTransform. I assume LayoutTransform would produce the same results, but I haven't tested it.
Giffyguy