Posted 15 years ago
by Marc Cygnus
-
Software Developer,
Fire Em Up
I have an app with several CircularGauge instances; I've defined a Style to help organize several common visual attributes. I'm now having a problem wherein some properties of a CircularScale are set properly by the Style but others (namely, BarExtent) are not.
Here's the style (simplified):Here's an instance of a CircularGauge (again, simplified):
(There are, of course, ticks and a needle defined...)
The Style properly applies all properties correctly except for BarExtent. I can verify this by editing the values in the Style and watching the designer reflect the changes.
If I add an explicit BarExtent setting in the gauge:CircularScale element, that works.
At first, I thought it could be some bug or issue relating to the fact that BarExtent is not defined by CircularGauge but rather is inherited from ScaleBase, but besides the fact that that shouldn't matter, the Background property is also inherited from ScaleBase, and that works fine in the Style.
Please help! If need be, I could generate a small sample application that reproduces the issue, but I'm under a terrible timeline here, and I'm hoping that there's a simple explanation for the issue (given my schedule, I'd far rather hear "you're just an idiot - you forgot X" over "hmm, looks like a bug". ;-)
Thanks!
-Cygnus
Here's the style (simplified):
<Style x:Key="gaugeScale" TargetType="gauge:CircularScale" >
<Setter Property="Radius" Value="82%" />
<Setter Property="StartAngle" Value="190" />
<Setter Property="SweepAngle" Value="160" />
<Setter Property="BarExtent" Value="2%" />
<Setter Property="Background" Value="#500000ff" />
</Style>
<gauge:CircularGauge Background="Black" ...>
<gauge:CircularGauge.Scales>
<gauge:CircularScale Style="{StaticResource gaugeScale}">
...
</gauge:CircularScale>
</gauge:CircularGauge.Scales>
</gauge:CircularGauge>
The Style properly applies all properties correctly except for BarExtent. I can verify this by editing the values in the Style and watching the designer reflect the changes.
If I add an explicit BarExtent setting in the gauge:CircularScale element, that works.
At first, I thought it could be some bug or issue relating to the fact that BarExtent is not defined by CircularGauge but rather is inherited from ScaleBase, but besides the fact that that shouldn't matter, the Background property is also inherited from ScaleBase, and that works fine in the Style.
Please help! If need be, I could generate a small sample application that reproduces the issue, but I'm under a terrible timeline here, and I'm hoping that there's a simple explanation for the issue (given my schedule, I'd far rather hear "you're just an idiot - you forgot X" over "hmm, looks like a bug". ;-)
Thanks!
-Cygnus