Hi Torrent,
Query 1: On UWP, the event is triggered only the first time I zoom.
We have made ZoomStart to work properly by hooking ManipulationCompleted event of chart in Custom Renderer as shown in the below code snippets.
Code snippet [C#]:
|
public class CustomRenderer : SfChartRenderer
{
SfChart formsChart;
protected override void OnElementChanged(ElementChangedEventArgs<SfChart> e)
{
base.OnElementChanged(e);
if (Control != null)
{
formsChart = e.NewElement as SfChart;
Control.ManipulationCompleted += Control_ManipulationCompleted;
}
}
private void Control_ManipulationCompleted(object sender, Windows.UI.Xaml.Input.ManipulationCompletedRoutedEventArgs e)
{
typeof(ChartAxis).GetTypeInfo().GetDeclaredProperty("CanTriggerZoomStart").SetValue(formsChart.PrimaryAxis, true);
typeof(ChartAxis).GetTypeInfo().GetDeclaredProperty("CanTriggerZoomStart").SetValue(formsChart.SecondaryAxis, true);
}
} |
Query 2: On Android, it gives me this error : System.Reflection.TargetException: Non-static method requires a target.
We have prepared a sample by hooking ZoomStart event. The sample works fine and we have attached the sample for your reference. Could you please check with the sample in below location?
If still you face the problem, please revert us by modifying the sample based on your application along with replication procedure. This would be helpful for us to serve you.
Regards,
Divya Venkatesan