隐式样式在SciCharts WPF中不起作用?

问题描述 投票:0回答:1

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

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

我已经尝试将样式放在UserControl.Resources中的SciChartSurface.Resources中的Application.Resources中,并且绝对没有运气。

wpf scichart
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并且很快被推到了夜间。

最好的问候,安德鲁

[SciChart技术主管]

© www.soinside.com 2019 - 2024. All rights reserved.