Pre loader

Error in applying BaseRenderableSeries within Style to FastLineRenderableSeries

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

0
0

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.

  • You must to post comments
0
0

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>
  • bbmat
    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 to post comments
Showing 1 result
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies