Hello,
My user has a requirement to be able to double-click the y-axis area of the XamDataChart and spawn a dialog using the parameter of the y-axis for specific logic. In addition to this, the user already has the ability to add up to 3 additional y-axis's to the chart and each of these new axis should have similar behavior with the double click. I am currently using logic like this set up a command on my view model that fires on the double click of the axis.
<i:Interaction.Triggers> <i:EventTrigger EventName="MouseDoubleClick"> <i:InvokeCommandAction Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl, AncestorLevel=2, Mode=FindAncestor}, Path=DataContext.AxesDoubleClickEvent}" CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=ig:NumericYAxis}}" /> </i:EventTrigger> </i:Interaction.Triggers> private ICommand? _axesDoubleClickEvent; public ICommand AxesDoubleClickEvent { get { return _axesDoubleClickEvent ??= new DelegateCommand<NumericYAxis>(AxesDoubleClickEventImplementation); } } private void AxesDoubleClickEventImplementation(NumericYAxis e) { var test = e.DataContext; }
This functions, however, the area for the double click is only hugging the chart and does not include the axis values as an area where the double click can be registered. Also, this does not seem to work on subsequent axis/series that are added at runtime. Is there a way of increasing the area where the double click event listens to include the values of the axis? Also, is there a way of handling dynamically added axis's and is this the best way of going about handling the double click event. Please let me know if I should further elaborate on my issues/requirements. Thank you!
For the labels I think it would be best to write a LabelPanelStyle. I just haven't figured out enforcing double clicking. I attached an example of what I have so far below.
6545.ContextMenuChartAxis.zip