Mr Bell
Mr Bell

Reputation: 9366

How to use a system color in a lineargradientbrush in wpf

I have a gradient background for my window

<Window.Background>
        <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
            <GradientStop Offset="0" Color="White" />
            <GradientStop Offset="0" Color="Black" />
        </LinearGradientBrush>
    </Window.Background>

I would like to replace the black gradient stop with the system color for control faces (the color buttons and dialog boxes are by default)

Whats the syntax?

Upvotes: 1

Views: 857

Answers (1)

HCL
HCL

Reputation: 36775

You can specify a Color through the static-extension:

<GradientStop Offset="0" Color="{x:Static SystemColors.ActiveBorderColor}" />

Upvotes: 1

Related Questions