I trying to get the same color gradient in C# code
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="Black" Offset="0"/>
<GradientStop Color="#FF4557BA" Offset="1"/>
</LinearGradientBrush>
So far I have this but it is wrong(can't find how to enter in Hex so I tried argb)
LinearGradientBrush gradient = new LinearGradientBrush();
gradient.StartPoint = new Point( 0, 0 );
gradient.EndPoint = new Point( 1, 1 );
GradientStop color1 = new GradientStop();
color1.Color = Colors.Black;
color1.Offset = 0;
gradient.GradientStops.Add(color1);
GradientStop color2 = new GradientStop();
color2.Color = Color.FromArgb(100,69,87,186);
color2.Offset = 1;
gradient.GradientStops.Add( color2 );
Edit
I am trying to do this in wp7 where I have this gradient in a property that I will bind to the "background" of my controls.
I however it just seems like I get a solid color and not the gradient.