ChartTrackBallBehavior CommandParameter Issue

5 posts, 0 answers
  1. Markus
    Markus avatar
    42 posts
    Member since:
    Nov 2012

    Posted 12 Sep 2013 Link to this post

    first of all I'm using the MVVM pattern.

    In order to get the ActualVisibleRange from my DateTimeContinuousAxis i hooked up to the LayoutUpdated event and passed the axis via the CommandParameter:

    <telerik:DateTimeContinuousAxis x:Name="horizontalAxis" LabelFormat="dd.MM hh:mm" LabelFitMode="MultiLine">   
            <i:EventTrigger EventName="LayoutUpdated">
                <i:InvokeCommandAction Command="{Binding LayoutUpdatedCommand}" CommandParameter="{Binding ElementName=horizontalAxis}"/>

    When I apply this pattern to the ChartTrackBallBehavior to pass the Data of the Behavior i got an error:

    <telerik:ChartTrackBallBehavior x:Name="trackBallBehavior" ShowTrackInfo="True">
            <i:EventTrigger EventName="TrackInfoUpdated">
                <i:InvokeCommandAction Command="{Binding TrackInfoUpdatedCommand}" CommandParameter="{Binding ElementName=trackBallBehavior}"/>

    Is there an alternative way to pass the data of the ChartTrackBallBehavior to my ViewModel?

    Regards Markus
  2. Markus
    Markus avatar
    42 posts
    Member since:
    Nov 2012

    Posted 13 Sep 2013 Link to this post

    Small update,

    when I use Caliburn Micro to pass the EventArgs like this:

    <telerik:ChartTrackBallBehavior ShowTrackInfo="True" cal:Message.Attach="[TrackInfoUpdated] = [TrackInfoUpdated($eventArgs)]"/>

    It compiles but on start i got the same exception: XamlParseException

    Greetings Markus
  3. DevCraft R3 2016 release webinar banner
  4. Petar Kirov
    Petar Kirov avatar
    425 posts

    Posted 17 Sep 2013 Link to this post

    Hi Markus,

    Thanks for reporting this problem. I was able to reproduce it. It seams that EventTrigger does not supported forwarding events from non UIElement-derived classes. (ChartBehaviors do not derive from UIElement for performance considerations.)

    I have notified our development team, so they can investigate it more thoroughly. You can follow the progress of this item here on PITS.
    For the time being, you will need to use event handler in code-behind to call the ViewModel's command.

    Petar Kirov
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  5. Markus
    Markus avatar
    42 posts
    Member since:
    Nov 2012

    Posted 17 Sep 2013 Link to this post

    Thank you very much!
  6. James
    James avatar
    2 posts
    Member since:
    Mar 2012

    Posted 02 Oct 2013 Link to this post

    Hi - if you subclass ChartTrackBallBehavior with your own custom behavior and hook an ICommand Dependency property to the TrackInfoUpdated event you can use this so that everytime this event fires it calls your Command Delegate on your view model.. I've written a class which will do this today - would you like the source code? It works pretty well and updates the title of the tracker ball on my chart each time I focus on a new point on the series..

    Best Regards,


Back to Top
DevCraft R3 2016 release webinar banner