I created a linearGradientBrush inside “Application.Resources” and tried to call it with one of the style setters. The compiler says the name could not be resolved. Could not see why….
<Style x:Key="GridTextBoxStyle" TargetType="TextBox">
<Setter Property="Background" Value="{StaticResource TextBlinearBrush}"/>
</Style>
<LinearGradientBrush x:Key="TextBlinearBrush" EndPoint="1,0.5" StartPoint="0,0.5">
<GradientStop Color="Black" Offset="0" />
<GradientStop Color="Gray" Offset="1" />
<GradientStop Color="DarkGray" Offset="0.541" />
</LinearGradientBrush>
You’ll need to define the brush before it is used. Just move the
LinearGradientBrushabove theStylewhere it is referenced and that should do the trick.