0

我试图在 SciCharts 的 AxisPane 上设置一些隐式样式——甚至只是为了改变背景颜色,ala:

<Style TargetType="{x:Type SciCharts:AxisPanel}">
    <Setter Property="Background" Value="Red"></Setter>
</Style>

我尝试将样式放在 Application.Resources、SciChartSurface.Resources 内、UserControl.Resources 中,但绝对没有运气。

4

1 回答 1

1

问题是 AxisPanel 缺少 DefaultStyleKey 并且由于模板中默认设置了各种属性,因此未应用隐式样式。

我们向 AxisBase 添加了一个名为 AxisPanelStyle 的属性。这使您可以通过父轴将样式直接应用于轴面板:

 <s:SciChartSurface>
      <s:SciChartSurface.XAxis>
           <s:NumericAxis AxisPanelStyle="{StaticResource AStyleWithTargetTypeAxisPanel}"/>              
      </s:SciChartSurface.XAxis>
 </s:SciChartSurface>

此更改已提交至 scichart v5.1.0.11306 并很快推送到 nightly build。

最好的问候,安德鲁

[SciChart 技术负责人]

于 2018-03-02T20:06:09.503 回答