Applying the following style to a FastLineRenderableSeries works fine:
<Style TargetType="s:FastLineRenderableSeries">
<Setter Property="SeriesColor" Value="LightGreen" />
<Setter Property="PointMarkerTemplate">
<Setter.Value>
<ControlTemplate>
<s:EllipsePointMarker Fill="LightGreen" Stroke="LightGreen" StrokeThickness="3" Width="7" Height="7"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
But the following does not work at all:
<Style TargetType="s:BaseRenderableSeries">
<Setter Property="SeriesColor" Value="white"/>
<Setter Property="PointMarkerTemplate">
<Setter.Value>
<ControlTemplate TargetType="{x:Type s:BasePointMarker}">
<s:EllipsePointMarker Fill="White" Stroke="White" StrokeThickness="3" Height="5" Width="5"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
a) Could this be a bug? I want this style to apply to all FastLineRenderableSeries and XyScatterRenderableSeries.
b) I noticed the style is only applied if SeriesColor and PointMarkers are not assigned at the time of RenderableSeries instantiation.
- bbmat asked 9 years ago
- last edited 9 years ago
- You must login to post comments
We have this implicit style defined in our Default.xaml (which holds control templates of all SciChart parts)
<Style x:Key="DefaultRenderableSeriesStyle" TargetType="r:BaseRenderableSeries">
<Setter Property="RolloverMarkerTemplate">
<Setter.Value>
<ControlTemplate>
<r:TemplatableControl ContentTemplate="{StaticResource DefaultRolloverMarkerTemplate}" />
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="LegendMarkerTemplate" Value="{StaticResource DefaultLegendMarkerTemplate}" />
</Style>
<Style BasedOn="{StaticResource DefaultRenderableSeriesStyle}" TargetType="r:BaseRenderableSeries" />
It’s true we don’t define a PointMarkerTemplate, but the style is being applied.
Is it possible your style is not being applied for some reason? Style inheritance and precedence is a tricky topic in WPF.
The other thing you could try is basing your implicit style on ours, e.g.
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<!-- Include our Default.xaml resource dictionary -->
<ResourceDictionary Source="pack://application:,,,/Abt.Controls.SciChart.Wpf;component/Themes/BlackSteel.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<!-- Define your own implicit style and base it on our DefaultRenderableSeriesStyle -->
<Style BasedOn="{StaticResource DefaultRenderableSeriesStyle}" TargetType="r:BaseRenderableSeries">
<!-- Your style code here -->
</Style>
- Andrew Burnett-Thompson answered 9 years ago
-
I found what the issue was. If I assign pointmarkers at the time of instantiation of RenderableSeries then the style is not applied correctly. I create RenderableSeries in code behind and only if I do not define pointmarkers at time of creation of RenderableSeries does the style work.
- You must login to post comments
Please login first to submit.