Pre loader

MVVM and SelectedPointMarkers - struggling to access Coordinates of selected point inside ViewModel

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



I am developing an MVVM WPF application and need to access the SelectedPointMarkers property of DataPointSelectionModifier from the ViewModel.

From looking at the DataPointSelectionModifier documentation ( I can see how you can get the X and Y coordinate values of a selected point in a view, by binding the PointMarkersSelectionModifier to a listbox.

However this doesn’t really help me, I need to get the coordinates of the SelectedPointMarker into a property inside the ViewModel that can be accessed, rather than just binding to a listbox in the view itself.

I’ve also looked at this similar post: (, but I had no luck getting Kenishis solution to work in my case.

How can i do this?


  • You must to post comments

Hi Sean,

It’s possible to solve by inheriting the DataPointSelectionModifier and creating your own dependency property for SelectedPointMarkers

public class DataPointSelectionModifierExtended : DataPointSelectionModifier
    public static readonly DependencyProperty AllSelectedPointMarkersProperty = DependencyProperty.Register
        new PropertyMetadata(new ObservableCollection<DataPointInfo>()));

    public ObservableCollection<DataPointInfo> AllSelectedPointMarkers
        get => (ObservableCollection<DataPointInfo>)GetValue(AllSelectedPointMarkersProperty);
        set => SetValue(AllSelectedPointMarkersProperty, value);

    public DataPointSelectionModifierExtended()
        SelectedPointMarkers.CollectionChanged += OnCollectionChanged;

    private void OnCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
        switch (e.Action)
            case NotifyCollectionChangedAction.Add:
                e.NewItems.Cast<DataPointInfo>().ForEachDo(p => AllSelectedPointMarkers.Add(p));

            case NotifyCollectionChangedAction.Reset:

            case NotifyCollectionChangedAction.Remove:
                e.OldItems.Cast<DataPointInfo>().ForEachDo(p => AllSelectedPointMarkers.Remove(p));

            case NotifyCollectionChangedAction.Replace:
            case NotifyCollectionChangedAction.Move:
            default: throw new NotImplementedException();

Best regards,

  • 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