Pre loader

HorizontalGroupHelper.HorizontalChartGroup set "syncWidthGroup" dynamically through code.

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

Answered
2
0

Hi

This is a little snippet of my code

<s:SciChartSurface SeriesSource="{Binding ChartSeries}"
                   YAxes="{Binding YAxisCollection}"
                   XAxis="{Binding XAxis}"
                   Annotations="{Binding AnnotationCollection}"
                   s:HorizontalGroupHelper.HorizontalChartGroup="horizontalChartGroup">

I would like to be able to set throught my ViewModel the “syncWidthGroup” of the HorizontalChartGroup like this.

s:HorizontalGroupHelper.HorizontalChartGroup="{Binding ChartGroup}"

But an exception is thrown saying I can only bind to DP og DO.

    System.Windows.Markup.XamlParseException occurred
  HResult=-2146233087
  Message=A 'Binding' cannot be set on the 'SetHorizontalChartGroup' property of type 'SciChartSurface'. A 'Binding' can only be set on a DependencyProperty of a DependencyObject.
  Source=PresentationFramework
  LineNumber=14
  LinePosition=324
  StackTrace:
       at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
       at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
       at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
       at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
       at Sekal.DrillScene.Desktop.Application.Views.TrackView.InitializeComponent() in c:\dev\projects\SekalApplications\Client\Sekal.DrillScene.Desktop\obj\Debug\decoratedxaml\Application\Views\TrackView.xaml:line 1
       at Sekal.DrillScene.Desktop.Application.Views.TrackView..ctor() in c:\dev\projects\SekalApplications\Client\Sekal.DrillScene.Desktop\Application\Views\TrackView.xaml.cs:line 10
  InnerException: 

So how would I go about doing this through code and not xaml, as I use ViewModel first approach and ViewModels are dynamically appended to an Items collection? (Using Caliburn.Micro)

  • You must to post comments
Best Answer
1
0

Hi Sander,

Yuriy has fixed this indeed, but forgot to run the Nightly Build team city job. This has been done now, and the fix is available right now in v3.1.0 revision 5452

enter image description here

Best regards,
Andrew

  • 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