Pre loader

Pointmarker styles do not work for subclassed XyScatterRenderableSeriesViewModel

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

Closed
0
0

My issue is that the Pointmarker does not draw when I attempt to implement a custom renderable series view model. I’ve isolated it to the fact I am subclassing because the same code will draw if I replace my custom subclass with the base class.

I subclassed XyScatterRenderableSeriesViewModel like so:

public class CustomSeriesViewModel : XyScatterRenderableSeriesViewModel
{
    public CustomSeriesViewModel ()
    : base()
    {
    }
}

It is created like this:

return new CustomSeriesViewModel ()
        {
            // Note: the Pointmarker is created in the Xaml. See styles.
            StyleKey = "CustomSeriesStyle",
            DataSeries = dataSeries,
            IsSelected = true,
        };

And added into a list of type List IRenderableSeriesViewModel

If I replace the line new CustomSeriesViewModel () with new XyScatterRenderableSeriesViewModel(), the Pointmarker is drawn successfully. This is confusing to me, as there’s no other code in the subclass than the constructor, so I would expect it to be substitutable.

The style is responsible for defining the Pointmarker and looks like this:

 <Style x:Key="CustomSeriesStyle" TargetType="s:BaseRenderableSeries" >
    <Setter Property="s:TooltipModifier.TooltipTemplate" Value="{StaticResource CustomTooltipTemplate}" />
    <Setter Property="s:TooltipModifier.TooltipContainerStyle" Value="{StaticResource CustomTooltipStyle}" />
    <Setter Property="PointMarker">
        <Setter.Value>
            <s:SpritePointMarker>
                <s:SpritePointMarker.PointMarkerTemplate>
                    <ControlTemplate>
                        <Grid>
                            <Ellipse Width="13" Height="13" Fill="White"/>
                            <Ellipse Width="9" Height="9" Fill="{StaticResource CustomBrush}"/>
                        </Grid>
                    </ControlTemplate>
                </s:SpritePointMarker.PointMarkerTemplate>
            </s:SpritePointMarker>
        </Setter.Value>
    </Setter>
</Style>
Version
5.4.0.12119
  • Andrew Burnett-Thompson
    Hi John, we will investigate this and get back to you. Thanks for a clear bug report.
  • John Chow
    Resolved, issue was somewhere else
  • You must to post comments
Showing 0 results

Try SciChart Today

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

Start TrialCase Studies