Pre loader

MouseDoubleClick EventTrigger

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

I want to implement a PopUpWindowAction and InteractionRequestTrigger via the Micrsoft PRISM Libray:
But it starts with basic problems:
I’m not able to create a correct invokeCommandAction, the RaisItemSelection method gets never executed?

Xaml:

<s:SciChartSurface>
  <i:Interaction.Triggers>
                <i:EventTrigger EventName="MouseDoubleClick">
                    <i:InvokeCommandAction Command="{Binding MouseDoubleClickCommand}" CommandParameter="{}" />
                </i:EventTrigger>
    </i:Interaction.Triggers>
</<s:SciChartSurface>

xaml.cs:

MouseDoubleClickCommand = new DelegateCommand<object>(RaiseItemSelection);
 private void RaiseItemSelection(object obj)
        {
        }
  • You must to post comments
0
0

Ok, my guess would be that you are also using the ZoomExtentsModifier. If so, this will set e.Handled=True on the MouseDoubleClick event on the chart.

Another way to handle this is to create a custom modifier. Sounds a bit farfetched, but if you want full event support and manipulation of the chart, modifiers are the way to go. See our series on Custom ChartModifiers here. For instance, something like this would handle the event off the chart, and also allow forwarding on to ViewModel.

public class DoubleClickModifier : ChartModifierBase
{
    public event EventHandler<EventArgs> ChartDoubleClick;

    public override void OnModifierDoubleClick(ModifierMouseArgs e)
    {
        base.OnModifierDoubleClick(e);

        var handler = ChartDoubleClick;
        if (handler != null)
        {
            handler(this.ParentSurface, EventArgs.Empty);
            e.Handled = true; // NOTE this will prevent double click going to modifiers lower down in the stack
        }
    }
}

Something like that, you could insert this modifier into the SciChartSurface.ChartModifier property (or inside a modifier group) and use it to redirect events to your view model via EventToCommand.

Hope this helps,

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