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" />