Breaking Change T887738
Visible to All Users

Custom labels no longer inherit their Foreground from GaugeControls's container

What Changed

In versions prior to 20.1.4, LinearGaugeControl inherited its Foreground from its parent control, and custom labels used this brush. Regular labels used their own Foreground value.

XAML
<dx:ThemedWindow Foreground="Yellow"> <dxga:LinearGaugeControl> <dxga:LinearGaugeControl.Scales> <dxga:LinearScale EndValue="10" StartValue="0"> <dxga:LinearScale.CustomLabels> <dxga:ScaleCustomLabel Content="Test label" /> </dxga:LinearScale.CustomLabels> </dxga:LinearScale> </dxga:LinearGaugeControl.Scales> <dxga:LinearGaugeControl.Model> <dxga:LinearThemeableModel /> </dxga:LinearGaugeControl.Model> </dxga:LinearGaugeControl> </dx:ThemedWindow>

In version 20.1.4, we specify Foreground for gauge controls in our themes, so custom labels no longer use the Foreground value specified at the parent control's level.

When you set LinearGaugeControl.Foreground, both regular and custom labels use this brush.

XAML
<dxga:LinearGaugeControl Foreground="Yellow">

Reasons for Change

In version 20.1.4, we made it possible to specify Foreground for labels at the GaugeControl level. Custom labels use the same approach to achieve consistent appearance.

The LinearGaugeControl.Foreground property value is no longer inherited from its parent control, as this caused appearance issues in certain themes.

Impact on Existing Apps

The Foreground property set at the parent control (e.g., a Window) level no longer affects custom labels in gauge controls.

How to Update Existing Apps

Set Foreground at the GaugeContol level.

XAML
<dxga:LinearGaugeControl Foreground="Yellow">

If you wish to customize only custom labels, set Foreground for them:

XAML
<dxga:ScaleCustomLabel Content="Test label" Foreground="Green" />

Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.